database

package
v0.0.0-...-6d6f642 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(db *gorm.DB, username, password string) error

func AuthUser

func AuthUser(db *gorm.DB, username, password string) error

func ConnectDB

func ConnectDB() (*gorm.DB, error)

ConnectDB uses .env for connection to DB with GORM

Types

type User

type User struct {
	ID           uint      `gorm:"primaryKey"`
	Username     string    `gorm:"unique;not null"`
	PasswordHash string    `gorm:"not null"`
	CreatedAt    time.Time `gorm:"autoCreateTime"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL