Documentation ¶
Index ¶
Constants ¶
Variables ¶
View Source
var ErrInvalidArgument = errors.New("invalid arguments")
Functions ¶
func IsInvalidArgumentError ¶
IsInvalidArgumentError returns true if err represents a ErrInvalidArgument error.
func IsRecordNotFound ¶
IsRecordNotFound returns true if err represents a RecordNotFound error.
Types ¶
type UserTab ¶
type UserTab struct { Id int64 `gorm:"column:id"` Username string `gorm:"column:username"` // the username Password string `gorm:"column:password"` Nickname string `gorm:"column:nickname"` // nickname Email string `gorm:"column:email"` // user email address Avatar string `gorm:"column:avatar"` }
UserTab describes the table schema structure.
type UserTabModel ¶
type UserTabModel interface { Insert(ctx context.Context, data *UserTab) error Delete(ctx context.Context, id int64) error Update(ctx context.Context, data *UserTab) error FindOne(ctx context.Context, id int64) (*UserTab, error) FindOneByEmail(ctx context.Context, email string) (*UserTab, error) FindOneByUsername(ctx context.Context, username string) (*UserTab, error) Query(ctx context.Context, filters string, opts ...options.QueryOption) ([]*UserTab, int64, error) WithDB(db *gorm.DB) UserTabModel }
UserTabModel is an interface that wraps the CURD method.
func NewUserTabModel ¶
func NewUserTabModel(conn *gorm.DB) UserTabModel
NewUserTabModel creates a defaultUserTabModel.
Click to show internal directories.
Click to hide internal directories.