Documentation ¶
Index ¶
- type API
- type UI
- type Variable
- func (h Variable) DeleteModel(r *http.Request) error
- func (h Variable) Destroy(w http.ResponseWriter, r *http.Request)
- func (h Variable) IndexWithRelations(r *http.Request) ([]*variable.Variable, database.Paginator, error)
- func (h Variable) Store(w http.ResponseWriter, r *http.Request)
- func (h Variable) StoreModel(r *http.Request) (*variable.Variable, variable.Form, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Variable // Prefix is the part of the URL under which the API is being served, for // example "/api". Prefix string }
API is the handler for handling API requests made for image creation, and management.
func (API) Destroy ¶
func (h API) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the variable in the given request context from the database. This serves no content in the response body.
func (API) Index ¶
func (h API) Index(w http.ResponseWriter, r *http.Request)
Index serves the JSON encoded list of variables for the given request. If multiple pages of variables are returned then the database.Paginator is encoded in the Link response header.
type UI ¶
type UI struct {
Variable
}
UI is the handler for handling UI requests made for variable creation, and management.
type Variable ¶
Variable is the base handler that provides shared logic for the UI and API handlers for variable creation, and management.
func (Variable) DeleteModel ¶
DeleteModel removes the variable in the given request context from the database.
func (Variable) Destroy ¶
func (h Variable) Destroy(w http.ResponseWriter, r *http.Request)
Destroy removes the variable in the given request context from the database. This redirects back to the request's referer.
func (Variable) IndexWithRelations ¶
func (h Variable) IndexWithRelations(r *http.Request) ([]*variable.Variable, database.Paginator, error)
IndexWithRelations retrieves a slice of *variable.Variable models for the user in the given request context. All of the relations for each variable will be loaded into each model we have. If any of the keys have a bound namespace, then the namespace's user will be loaded too. A database.Paginator will also be returned if there are multiple pages of variables.
func (Variable) Store ¶
func (h Variable) Store(w http.ResponseWriter, r *http.Request)
Store validates the form submitted in the given request for creating a variable. If validation fails then the user is redirected back to the request referer, otherwise they are redirect back to the variable index.
func (Variable) StoreModel ¶
StoreModel unmarshals the request's data into a variable, validates it and stores it in the database. Upon success this will return the newly created variable. This also returns the form for creating a variable.