Documentation ¶
Index ¶
- Variables
- type User
- func (u *User) CanBeCreatedBy(other apikit.User) bool
- func (u *User) CanBeDeletedBy(other apikit.User) bool
- func (u *User) CanBeModifiedBy(other apikit.User) bool
- func (u *User) CanBeViewedBy(other apikit.User) bool
- func (u *User) Delete() error
- func (u *User) HasAdminPrivileges() bool
- func (u *User) IsNewRecord() bool
- func (u *User) Save() error
- func (u *User) UniqueID() uint64
- func (u *User) Validate(v *revel.Validation)
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthenticationHandler apikit.AuthenticationFunction = func(username, password string) apikit.User { for _, u := range usersDB { if u.Username == username && u.Password == password { return u } } return nil }
The authentication mechanism for our RESTControllers
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID uint64 `json:"id"` Username string `json:"username"` FavoriteColor string `json:"favorite_color"` Password string `json:"-"` }
A model that will be provided by a RESTController
func GetUserByID ¶
Other User-related methods and data not-specific to RESTControllers
func (*User) CanBeCreatedBy ¶
func (*User) CanBeDeletedBy ¶
func (*User) CanBeModifiedBy ¶
func (*User) CanBeViewedBy ¶
Implementation of RESTObject interface
func (*User) HasAdminPrivileges ¶
func (*User) IsNewRecord ¶
func (*User) Validate ¶
func (u *User) Validate(v *revel.Validation)
Click to show internal directories.
Click to hide internal directories.