Documentation
¶
Index ¶
- func CreateDefaultUser(db *DB)
- func MarkAsDeleted(db *DB, sqlMarkAsDeleted string, id int64) error
- func Migrate(db *DB)
- func SelectOne(db *DB, sqlSelect string, argSelect interface{}, dest interface{}) error
- func Upsert(db *DB, sqlUpsert string, sqlSelectByID string, argUpsert interface{}, ...) error
- type DB
- type ErrDuplicateRow
- type LimitAndOffset
- type User
- func (u *User) Create(db *DB) (*User, error)
- func (u *User) Delete(db *DB) error
- func (u *User) GetByEmail(db *DB) (*User, error)
- func (u *User) GetByID(db *DB) (*User, error)
- func (u *User) GetByUsername(db *DB) (*User, error)
- func (u *User) List(db *DB, limit int, offset int) ([]*User, error)
- func (u *User) Update(db *DB) (*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarkAsDeleted ¶
MarkAsDeleted ...
Types ¶
type ErrDuplicateRow ¶
ErrDuplicateRow ...
func (*ErrDuplicateRow) Error ¶
func (err *ErrDuplicateRow) Error() string
type LimitAndOffset ¶
LimitAndOffset ...
type User ¶
type User struct { ID int64 `json:"id"` Username string `json:"username" validate:"required,alphanum"` Password string `json:"password" validate:"required,password"` Email string `json:"email" validate:"required,email"` FirstName sql.NullString `json:"first_name" db:"first_name"` LastName sql.NullString `json:"last_name" db:"last_name"` Role auth.Role `json:"role" validate:"required,role"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Deleted sql.NullTime `json:"deleted,omitempty"` }
User ...
Click to show internal directories.
Click to hide internal directories.