storage

package
v0.0.0-...-ffd5234 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMigration

func InitMigration()

Types

type Account

type Account struct {
	BaseModel
	NickName string `json:"nickName"`
	Email    string `json:"email"`
	Password []byte `json:"-"`
}

func CreateAccount

func CreateAccount(nickName, email, pass string) (*Account, error)

func GetAccount

func GetAccount(nickName string, pass string) (*Account, error)

func GetAccountById

func GetAccountById(id int64) (*Account, error)

func (*Account) Token

func (account *Account) Token() string

type BaseModel

type BaseModel struct {
	Id        int64      `json:"id" gorm:"column:id; type:serial; unsigned; primary_key; auto_increment;not null;"`
	CreatedAt time.Time  `json:"-"`
	UpdatedAt time.Time  `json:"-"`
	DeletedAt *time.Time `sql:"index" json:"-"`
}

type Token

type Token struct {
	Id int64
	jwt.StandardClaims
}

func ParseToken

func ParseToken(t string, secret []byte) (*Token, error)

Jump to

Keyboard shortcuts

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