model

package
v0.0.0-...-61e4535 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// UserNick generate for User.Nick <nick::string>
	UserNick modeler.FIELD = 9

	// UserName generate for User.Name <name::string>
	UserName modeler.FIELD = 10

	// UserSecret generate for User.Secret <secret::sql.NullString>
	UserSecret modeler.FIELD = 11

	// UserTotp generate for User.Totp <totp::sql.NullString>
	UserTotp modeler.FIELD = 12
)

Variables

View Source
var (
	UserFields modeler.EntityInfo[int64, User]
)

Functions

This section is empty.

Types

type User

type User struct {
	modeler.FullModelEntity[int64]
	Nick   string         `db:"nick" json:"nick"`
	Name   string         `db:"name" json:"name"`
	Secret sql.NullString `db:"secret" json:"secret"`
	Totp   sql.NullString `db:"totp" json:"totp"`
}

func (*User) CheckSecret

func (e *User) CheckSecret(raw string) bool

func (*User) CheckTOTP

func (e *User) CheckTOTP(code string) bool

type UserEntity

type UserEntity struct {
	User
	modeler.BaseEntity[int64, User]
}

func (*UserEntity) GetName

func (c *UserEntity) GetName() string

func (*UserEntity) GetNick

func (c *UserEntity) GetNick() string

func (*UserEntity) GetSecret

func (c *UserEntity) GetSecret() sql.NullString

func (*UserEntity) GetTotp

func (c *UserEntity) GetTotp() sql.NullString

func (*UserEntity) SetName

func (c *UserEntity) SetName(v string) bool

func (*UserEntity) SetNick

func (c *UserEntity) SetNick(v string) bool

func (*UserEntity) SetSecret

func (c *UserEntity) SetSecret(v sql.NullString) bool

func (*UserEntity) SetTotp

func (c *UserEntity) SetTotp(v sql.NullString) bool

type UserStore

type UserStore struct {
	modeler.SqlxExecutor
	// contains filtered or unexported fields
}

func NewUserStore

func NewUserStore(table string, lx *jsql.SQLx) *UserStore

func (*UserStore) ById

func (s *UserStore) ById(id int64) *UserEntity

func (*UserStore) ByName

func (s *UserStore) ByName(name string) *UserEntity

func (*UserStore) Close

func (s *UserStore) Close(ctx context.Context) bool

Jump to

Keyboard shortcuts

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