Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorBody ¶
type ErrorBody struct { EveryBody Error ErrorDetails `json:"error"` }
ErrorBody is the body that is returned on errors
func ErrorResponse ¶
ErrorResponse returns a map that can be given as an argument to c.JSON
type ErrorDetails ¶
ErrorDetails are details about errors
type EventAPI ¶
type EventAPI interface { RESTAPI }
EventAPI is the interface for the Event REST methods
func NewEventAPI ¶
NewEventAPI takes an ORM and returns an NewEventHandle
type EventHandle ¶
EventHandle contains the orm layer for User objects
func (*EventHandle) Delete ¶
func (e *EventHandle) Delete(c *gin.Context)
Delete deletes an event and returns the object
func (*EventHandle) GetByID ¶
func (e *EventHandle) GetByID(c *gin.Context)
GetByID gets an event by its ID
func (*EventHandle) Update ¶
func (e *EventHandle) Update(c *gin.Context)
Update updates an Event and returns it
type RESTAPI ¶
type RESTAPI interface { GetAll(c *gin.Context) GetByID(c *gin.Context) Create(c *gin.Context) Update(c *gin.Context) Delete(c *gin.Context) }
RESTAPI is an interface for implementation by REST controllers
type SuccessBody ¶
type SuccessBody struct { EveryBody Result interface{} `json:"result"` }
SuccessBody is the body that is returned on success
func SuccessResponse ¶
func SuccessResponse(action string, result interface{}) SuccessBody
SuccessResponse returns a map that can be given as an argument to c.JSON
type UserAPI ¶
UserAPI is the interface for the user API
func NewUserAPI ¶
NewUserAPI takes an ORM and returns a RESTAPI
type UserHandle ¶
UserHandle is a handle for the user API
func (*UserHandle) Create ¶
func (u *UserHandle) Create(c *gin.Context)
Create adds a user and returns it
func (*UserHandle) GetAll ¶
func (u *UserHandle) GetAll(c *gin.Context)
GetAll returns an array of all users
func (*UserHandle) GetByAlias ¶
func (u *UserHandle) GetByAlias(c *gin.Context)
GetByAlias returns a user with a certain alias
func (*UserHandle) GetByID ¶
func (u *UserHandle) GetByID(c *gin.Context)
GetByID returns a user with a certain id
func (*UserHandle) Update ¶
func (u *UserHandle) Update(c *gin.Context)
Update updates the properties of a user