Documentation ¶
Index ¶
- Constants
- func CloseUserStmts()
- func InitUserDataLayer(db *sql.DB) error
- func UsersToJSON(users []*User) ([]byte, error)
- type User
- func (user *User) Delete() error
- func (user *User) GetByID(loginID int, delFilter int) error
- func (user *User) Insert() error
- func (user *User) MarkDeleted(del bool, when nulls.Time) error
- func (user *User) PatchName(name string) error
- func (user *User) ToJSON() ([]byte, error)
- func (user *User) Update() error
- type UserDataLayer
Constants ¶
View Source
const ( EXISTS = iota DELETED = iota ALL = iota )
Variables ¶
This section is empty.
Functions ¶
func CloseUserStmts ¶
func CloseUserStmts()
CloseUserStmts should be called when prepared SQL statements aren't needed anymore
func InitUserDataLayer ¶
InitUserDataLayer prepares SQL statements and assigns the passed in DB pointer
func UsersToJSON ¶
Convert multiple User objects to JSON
Types ¶
type User ¶
type User struct { LoginID int `json:"loginid"` Name string `json:"name, omitempty"` Email nulls.String `json:"email”` Password string `json:"password" out:"false"` DeletedUser bool `json:”deleted”` DelOn nulls.Time `json:”deletedon”` }
func GetUsersByEmail ¶
Get Users by email
func GetUsersByName ¶
Get Users by name
func UserFromJSON ¶
Transform JSON into a User object
func (*User) MarkDeleted ¶
Mark a row as deleted and at time.Time
Click to show internal directories.
Click to hide internal directories.