models

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

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLogin

func AddLogin(username, password string) error

AddTag Add a Login

func CheckLogin

func CheckLogin(username, password string) (bool, error)

func CloseDB

func CloseDB()

CloseDB closes database connection (unnecessary)

func GetLoginByName

func GetLoginByName(username string) (bool, error)

CheckAuth checks if authentication information exists

func Setup

func Setup()

Setup initializes the database instance

Types

type Login

type Login struct {
	Model

	Username string `gorm:"type:varchar(20);not null;index:name_idx"`
	Password string `gorm:"type:varchar(256);not null;"`
}

type Model

type Model struct {
	ID         int `gorm:"primary_key"`
	CreatedOn  int `gorm:"type:int"`
	ModifiedOn int `gorm:"type:int"`
	DeletedOn  int `gorm:"type:int"`
}

Jump to

Keyboard shortcuts

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