Documentation ¶
Index ¶
- Constants
- func APIURL(path string) string
- func JSONApiRefLink(i interface{}, rel string) *jsonapi.Links
- func JSONApiSelfLink(i interface{}) *jsonapi.Links
- type ActionHolder
- type Extendable
- type FieldOption
- type JsonAPIAction
- func (a *JsonAPIAction) Field(name string, inputType inputType, value interface{}, requred bool) *JsonAPIAction
- func (a *JsonAPIAction) FieldWithOpts(name string, inputType inputType, value interface{}, requred bool, ...) *JsonAPIAction
- func (a *JsonAPIAction) Pagination(data *Pagination) *JsonAPIAction
- func (a *JsonAPIAction) RelFields(typeName string) *JsonAPIAction
- type JsonAPIField
- type Pagination
Constants ¶
View Source
const ( DELETE method = "DELETE" GET method = "GET" POST method = "POST" PATCH method = "PATCH" PUT method = "PUT" InputText inputType = "text" InputPass inputType = "password" InputBool inputType = "bool" InputNumber inputType = "number" InputSelect inputType = "select" IdString idType = "string" IdInt idType = "int" )
Variables ¶
This section is empty.
Functions ¶
func JSONApiRefLink ¶
JSONApiRefLink ref link helper
func JSONApiSelfLink ¶
JSONApiSelfLink self link helper
Types ¶
type ActionHolder ¶
type ActionHolder []*JsonAPIAction
func (*ActionHolder) AddAction ¶
func (ah *ActionHolder) AddAction(m method, name, urlHelper string, params ...interface{}) *JsonAPIAction
AddAction ...
func (*ActionHolder) RenderActions ¶
func (ah *ActionHolder) RenderActions() *jsonapi.Meta
RenderActions ...
type Extendable ¶
type Extendable interface {
Extend() error
}
type FieldOption ¶
type FieldOption struct { Label string `json:"label,omitempty"` Value interface{} `json:"value"` Meta map[string]interface{} `json:"meta,omitempty"` }
func FieldOptionsFromValues ¶
func FieldOptionsFromValues(values ...string) []FieldOption
type JsonAPIAction ¶
type JsonAPIAction struct { Method string `json:"method"` Name string `json:"name"` URL string `json:"url"` Multi bool `json:"multi"` Relationship bool `json:"relationship"` Fields []JsonAPIField `json:"fields"` }
func (*JsonAPIAction) Field ¶
func (a *JsonAPIAction) Field(name string, inputType inputType, value interface{}, requred bool) *JsonAPIAction
Field ...
func (*JsonAPIAction) FieldWithOpts ¶
func (a *JsonAPIAction) FieldWithOpts(name string, inputType inputType, value interface{}, requred bool, options []FieldOption) *JsonAPIAction
FieldWithOpts add field with options to action
func (*JsonAPIAction) Pagination ¶
func (a *JsonAPIAction) Pagination(data *Pagination) *JsonAPIAction
Pagination add pagination meta to action
func (*JsonAPIAction) RelFields ¶
func (a *JsonAPIAction) RelFields(typeName string) *JsonAPIAction
RelFields ...
type JsonAPIField ¶
type JsonAPIField struct { Name string `json:"name"` InputType string `json:"type"` Value interface{} `json:"value,omitempty"` Required bool `json:"required"` Options []FieldOption `json:"options,omitempty"` Data *Pagination `json:"data,omitempty"` }
type Pagination ¶
Click to show internal directories.
Click to hide internal directories.