app

package
v0.0.0-...-cfbe396 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalField

func MarshalField(source *Field, inErr error) (target map[string]interface{}, err error)

MarshalField validates and renders an instance of Field into a interface{} using view "default".

func MarshalSchema

func MarshalSchema(source *Schema, inErr error) (target map[string]interface{}, err error)

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.

func ValueHref

func ValueHref(name, value interface{}) string

ValueHref returns the resource href.

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

type DeleteSchemaContext struct {
	*goa.Context
	DeleteKeys bool

	HasDeleteKeys bool
	Name          string
}

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

type DeleteValueContext struct {
	*goa.Context
	Name  string
	Value string
}

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

func LoadField(raw interface{}) (res *Field, err error)

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

func UnmarshalField(source interface{}, inErr error) (target *Field, err error)

UnmarshalField unmarshals and validates a raw interface{} into an instance of Field

func (*Field) Dump

func (mt *Field) Dump() (res map[string]interface{}, err error)

Dump produces raw data from an instance of Field running all the validations. See LoadField for the definition of raw data.

func (*Field) Validate

func (mt *Field) Validate() (err error)

Validate validates the media type instance.

type GetSchemaContext

type GetSchemaContext struct {
	*goa.Context
	Name string
}

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

type ListSchemaContext struct {
	*goa.Context
}

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

OK sends a HTTP response with status code 200.

type ListValueContext

type ListValueContext struct {
	*goa.Context
	Name string
}

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

func LoadSchema(raw interface{}) (res *Schema, err error)

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

func UnmarshalSchema(source interface{}, inErr error) (target *Schema, err error)

UnmarshalSchema unmarshals and validates a raw interface{} into an instance of Schema

func (*Schema) Dump

func (mt *Schema) Dump() (res map[string]interface{}, err error)

Dump produces raw data from an instance of Schema running all the validations. See LoadSchema for the definition of raw data.

func (*Schema) Validate

func (mt *Schema) Validate() (err error)

Validate validates the media type instance.

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

type SetDefaultsSchemaContext struct {
	*goa.Context
	Name string
}

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

type ShowValueContext struct {
	*goa.Context
	Name  string
	Value string
}

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

type WriteAllValueContext struct {
	*goa.Context
	Name string
}

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

type WriteValueContext struct {
	*goa.Context
	Name  string
	Value string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL