Documentation
¶
Index ¶
- type PrivateUser
- type PublicUser
- type User
- func (u *User) Delete() *resterror.RestError
- func (u *User) Get() *resterror.RestError
- func (u *User) GetUserByEmail() (*User, *resterror.RestError)
- func (u *User) Marshaller(isPrivate bool) interface{}
- func (u *User) Save() *resterror.RestError
- func (u *User) Update() *resterror.RestError
- func (u *User) Validate() *resterror.RestError
- func (u *User) ValidateEmail() *resterror.RestError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrivateUser ¶
type PrivateUser struct { ID int64 `json:"id"` UserName string `json:"username"` Email string `json:"email"` DateCreated string `json:"date_created"` DateUpdated string `json:"date_updated"` }
PrivateUser contains all info about the user only avaibale to the owner user
type PublicUser ¶
PublicUser contains all the info about a user excluding some private/sensitive info
type User ¶
type User struct { ID int64 `json:"id"` UserName string `json:"username"` Email string `json:"email"` Password string `json:"password"` DateCreated string `json:"date_created"` DateUpdated string `json:"date_updated"` }
User defines the core User of the app
func (*User) GetUserByEmail ¶
GetUserByEmail returns a user with the given email address
func (*User) Marshaller ¶
Marshaller will marshall the incoming user and convert it into private/public user
func (*User) Validate ¶
Validate is used to validate wheather the current user provided is a valid user or not
func (*User) ValidateEmail ¶
ValidateEmail will trim and check if the email is valid or not and returns a rest error if invalid
Click to show internal directories.
Click to hide internal directories.