Documentation ¶
Index ¶
- func MarshalField(source *Field, inErr error) (target map[string]interface{}, err error)
- func MarshalSchema(source *Schema, inErr error) (target map[string]interface{}, err error)
- func MarshalSchemaCollection(source SchemaCollection, inErr error) (target []map[string]interface{}, err error)
- func MountSchemaController(service goa.Service, ctrl SchemaController)
- func MountValueController(service goa.Service, ctrl ValueController)
- func ValueHref(name, value interface{}) string
- type CreateSchemaContext
- type CreateSchemaPayload
- type DeleteSchemaContext
- type DeleteValueContext
- type Field
- type GetSchemaContext
- type ListSchemaContext
- type ListValueContext
- type Schema
- type SchemaCollection
- type SchemaController
- type SetDefaultsSchemaContext
- type ShowValueContext
- type UpdateSchemaContext
- type UpdateSchemaPayload
- type ValueController
- type WriteAllValueContext
- type WriteValueContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalField ¶
MarshalField validates and renders an instance of Field into a interface{} using view "default".
func MarshalSchema ¶
MarshalSchema validates and renders an instance of Schema into a interface{} using view "default".
func MarshalSchemaCollection ¶
func MarshalSchemaCollection(source SchemaCollection, inErr error) (target []map[string]interface{}, err error)
MarshalSchemaCollection validates and renders an instance of SchemaCollection into a interface{} using view "default".
func MountSchemaController ¶
func MountSchemaController(service goa.Service, ctrl SchemaController)
MountSchemaController "mounts" a Schema resource controller on the given service.
func MountValueController ¶
func MountValueController(service goa.Service, ctrl ValueController)
MountValueController "mounts" a Value resource controller on the given service.
Types ¶
type CreateSchemaContext ¶
type CreateSchemaContext struct { *goa.Context SetDefaults bool HasSetDefaults bool Payload *CreateSchemaPayload }
CreateSchemaContext provides the schema create action context.
func NewCreateSchemaContext ¶
func NewCreateSchemaContext(c *goa.Context) (*CreateSchemaContext, error)
NewCreateSchemaContext parses the incoming request URL and body, performs validations and creates the context used by the schema controller create action.
func (*CreateSchemaContext) Created ¶
func (ctx *CreateSchemaContext) Created(resp *Schema) error
Created sends a HTTP response with status code 201.
func (*CreateSchemaContext) InternalServerError ¶
func (ctx *CreateSchemaContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
type CreateSchemaPayload ¶
type CreateSchemaPayload struct { // a registered backend Backend string // human readable description Description string Fields []*Field Name string // root for this schema (backend prefix + name if not set) Root string }
CreateSchemaPayload is the schema create action payload.
func NewCreateSchemaPayload ¶
func NewCreateSchemaPayload(raw interface{}) (p *CreateSchemaPayload, err error)
NewCreateSchemaPayload instantiates a CreateSchemaPayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalCreateSchemaPayload ¶
func UnmarshalCreateSchemaPayload(source interface{}, inErr error) (target *CreateSchemaPayload, err error)
UnmarshalCreateSchemaPayload unmarshals and validates a raw interface{} into an instance of CreateSchemaPayload
type DeleteSchemaContext ¶
DeleteSchemaContext provides the schema delete action context.
func NewDeleteSchemaContext ¶
func NewDeleteSchemaContext(c *goa.Context) (*DeleteSchemaContext, error)
NewDeleteSchemaContext parses the incoming request URL and body, performs validations and creates the context used by the schema controller delete action.
func (*DeleteSchemaContext) InternalServerError ¶
func (ctx *DeleteSchemaContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*DeleteSchemaContext) NoContent ¶
func (ctx *DeleteSchemaContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*DeleteSchemaContext) NotFound ¶
func (ctx *DeleteSchemaContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type DeleteValueContext ¶
DeleteValueContext provides the value delete action context.
func NewDeleteValueContext ¶
func NewDeleteValueContext(c *goa.Context) (*DeleteValueContext, error)
NewDeleteValueContext parses the incoming request URL and body, performs validations and creates the context used by the value controller delete action.
func (*DeleteValueContext) InternalServerError ¶
func (ctx *DeleteValueContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*DeleteValueContext) NoContent ¶
func (ctx *DeleteValueContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*DeleteValueContext) NotFound ¶
func (ctx *DeleteValueContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type Field ¶
type Field struct { // the default for this field Default interface{} // human readable description Description string Name string // this field is required Required bool // root for this key (backend prefix + schema name if not set) Root string // type of value expected Type string }
Field media type Identifier: application/vnd.asteris.gestalt.field+json
func LoadField ¶
LoadField loads raw data into an instance of Field running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.
func UnmarshalField ¶
UnmarshalField unmarshals and validates a raw interface{} into an instance of Field
type GetSchemaContext ¶
GetSchemaContext provides the schema get action context.
func NewGetSchemaContext ¶
func NewGetSchemaContext(c *goa.Context) (*GetSchemaContext, error)
NewGetSchemaContext parses the incoming request URL and body, performs validations and creates the context used by the schema controller get action.
func (*GetSchemaContext) InternalServerError ¶
func (ctx *GetSchemaContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*GetSchemaContext) NotFound ¶
func (ctx *GetSchemaContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*GetSchemaContext) OK ¶
func (ctx *GetSchemaContext) OK(resp *Schema) error
OK sends a HTTP response with status code 200.
type ListSchemaContext ¶
ListSchemaContext provides the schema list action context.
func NewListSchemaContext ¶
func NewListSchemaContext(c *goa.Context) (*ListSchemaContext, error)
NewListSchemaContext parses the incoming request URL and body, performs validations and creates the context used by the schema controller list action.
func (*ListSchemaContext) InternalServerError ¶
func (ctx *ListSchemaContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*ListSchemaContext) OK ¶
func (ctx *ListSchemaContext) OK(resp SchemaCollection) error
OK sends a HTTP response with status code 200.
type ListValueContext ¶
ListValueContext provides the value list action context.
func NewListValueContext ¶
func NewListValueContext(c *goa.Context) (*ListValueContext, error)
NewListValueContext parses the incoming request URL and body, performs validations and creates the context used by the value controller list action.
func (*ListValueContext) InternalServerError ¶
func (ctx *ListValueContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*ListValueContext) NotFound ¶
func (ctx *ListValueContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*ListValueContext) OK ¶
func (ctx *ListValueContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type Schema ¶
type Schema struct { // a registered backend Backend string // human readable description Description string Fields []*Field Name string // root for this schema (backend prefix + name if not set) Root string }
Schema media type Identifier: application/vnd.asteris.gestalt.schema+json
func LoadSchema ¶
LoadSchema loads raw data into an instance of Schema running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.
func UnmarshalSchema ¶
UnmarshalSchema unmarshals and validates a raw interface{} into an instance of Schema
type SchemaCollection ¶
type SchemaCollection []*Schema
SchemaCollection media type Identifier: application/vnd.asteris.gestalt.schema+json; type=collection
func LoadSchemaCollection ¶
func LoadSchemaCollection(raw interface{}) (res SchemaCollection, err error)
LoadSchemaCollection loads raw data into an instance of SchemaCollection running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.
func UnmarshalSchemaCollection ¶
func UnmarshalSchemaCollection(source interface{}, inErr error) (target SchemaCollection, err error)
UnmarshalSchemaCollection unmarshals and validates a raw interface{} into an instance of SchemaCollection
func (SchemaCollection) Dump ¶
func (mt SchemaCollection) Dump() (res []map[string]interface{}, err error)
Dump produces raw data from an instance of SchemaCollection running all the validations. See LoadSchemaCollection for the definition of raw data.
func (SchemaCollection) Validate ¶
func (mt SchemaCollection) Validate() (err error)
Validate validates the media type instance.
type SchemaController ¶
type SchemaController interface { goa.Controller Create(*CreateSchemaContext) error Delete(*DeleteSchemaContext) error Get(*GetSchemaContext) error List(*ListSchemaContext) error SetDefaults(*SetDefaultsSchemaContext) error Update(*UpdateSchemaContext) error }
SchemaController is the controller interface for the Schema actions.
type SetDefaultsSchemaContext ¶
SetDefaultsSchemaContext provides the schema setDefaults action context.
func NewSetDefaultsSchemaContext ¶
func NewSetDefaultsSchemaContext(c *goa.Context) (*SetDefaultsSchemaContext, error)
NewSetDefaultsSchemaContext parses the incoming request URL and body, performs validations and creates the context used by the schema controller setDefaults action.
func (*SetDefaultsSchemaContext) InternalServerError ¶
func (ctx *SetDefaultsSchemaContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*SetDefaultsSchemaContext) NoContent ¶
func (ctx *SetDefaultsSchemaContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*SetDefaultsSchemaContext) NotFound ¶
func (ctx *SetDefaultsSchemaContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type ShowValueContext ¶
ShowValueContext provides the value show action context.
func NewShowValueContext ¶
func NewShowValueContext(c *goa.Context) (*ShowValueContext, error)
NewShowValueContext parses the incoming request URL and body, performs validations and creates the context used by the value controller show action.
func (*ShowValueContext) InternalServerError ¶
func (ctx *ShowValueContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*ShowValueContext) NotFound ¶
func (ctx *ShowValueContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*ShowValueContext) OK ¶
func (ctx *ShowValueContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type UpdateSchemaContext ¶
type UpdateSchemaContext struct { *goa.Context Name string SetDefaults bool HasSetDefaults bool Payload *UpdateSchemaPayload }
UpdateSchemaContext provides the schema update action context.
func NewUpdateSchemaContext ¶
func NewUpdateSchemaContext(c *goa.Context) (*UpdateSchemaContext, error)
NewUpdateSchemaContext parses the incoming request URL and body, performs validations and creates the context used by the schema controller update action.
func (*UpdateSchemaContext) InternalServerError ¶
func (ctx *UpdateSchemaContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*UpdateSchemaContext) NotFound ¶
func (ctx *UpdateSchemaContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*UpdateSchemaContext) OK ¶
func (ctx *UpdateSchemaContext) OK(resp *Schema) error
OK sends a HTTP response with status code 200.
type UpdateSchemaPayload ¶
type UpdateSchemaPayload struct { // a registered backend Backend string // human readable description Description string Fields []*Field Name string // root for this schema (backend prefix + name if not set) Root string }
UpdateSchemaPayload is the schema update action payload.
func NewUpdateSchemaPayload ¶
func NewUpdateSchemaPayload(raw interface{}) (p *UpdateSchemaPayload, err error)
NewUpdateSchemaPayload instantiates a UpdateSchemaPayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalUpdateSchemaPayload ¶
func UnmarshalUpdateSchemaPayload(source interface{}, inErr error) (target *UpdateSchemaPayload, err error)
UnmarshalUpdateSchemaPayload unmarshals and validates a raw interface{} into an instance of UpdateSchemaPayload
type ValueController ¶
type ValueController interface { goa.Controller Delete(*DeleteValueContext) error List(*ListValueContext) error Show(*ShowValueContext) error Write(*WriteValueContext) error WriteAll(*WriteAllValueContext) error }
ValueController is the controller interface for the Value actions.
type WriteAllValueContext ¶
WriteAllValueContext provides the value writeAll action context.
func NewWriteAllValueContext ¶
func NewWriteAllValueContext(c *goa.Context) (*WriteAllValueContext, error)
NewWriteAllValueContext parses the incoming request URL and body, performs validations and creates the context used by the value controller writeAll action.
func (*WriteAllValueContext) InternalServerError ¶
func (ctx *WriteAllValueContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*WriteAllValueContext) NotFound ¶
func (ctx *WriteAllValueContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*WriteAllValueContext) OK ¶
func (ctx *WriteAllValueContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type WriteValueContext ¶
WriteValueContext provides the value write action context.
func NewWriteValueContext ¶
func NewWriteValueContext(c *goa.Context) (*WriteValueContext, error)
NewWriteValueContext parses the incoming request URL and body, performs validations and creates the context used by the value controller write action.
func (*WriteValueContext) InternalServerError ¶
func (ctx *WriteValueContext) InternalServerError() error
InternalServerError sends a HTTP response with status code 500.
func (*WriteValueContext) NotFound ¶
func (ctx *WriteValueContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*WriteValueContext) OK ¶
func (ctx *WriteValueContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.