types

package
v0.0.0-...-e16400a Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	*schema.Schema
	NativeType string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Properties  []Schema
	Reference   string
	Validations []validations.Validation
	Item        Schema
	Items       *ItemSpec
	// contains filtered or unexported fields
}

func NewArray

func NewArray(ctx *Context, s *schema.Schema) *Array

func (Array) Example

func (o Array) Example(withoutReadOnly bool) interface{}

func (Array) ExampleString

func (o Array) ExampleString() string

func (Array) Format

func (o Array) Format() string

func (Array) Key

func (o Array) Key() string

func (Array) MarshalJSON

func (o Array) MarshalJSON() ([]byte, error)

func (Array) Raw

func (o Array) Raw() *schema.Schema

func (Array) ReadOnly

func (o Array) ReadOnly() bool

func (Array) Title

func (o Array) Title() string

type Boolean

type Boolean struct {
	*schema.Schema
	NativeType string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Validations []validations.Validation
	// contains filtered or unexported fields
}

func NewBoolean

func NewBoolean(ctx *Context, s *schema.Schema) *Boolean

func (Boolean) Example

func (o Boolean) Example(withoutReadOnly bool) interface{}

func (Boolean) ExampleString

func (o Boolean) ExampleString() string

func (Boolean) Format

func (o Boolean) Format() string

func (Boolean) Key

func (o Boolean) Key() string

func (Boolean) MarshalJSON

func (o Boolean) MarshalJSON() ([]byte, error)

func (Boolean) Raw

func (o Boolean) Raw() *schema.Schema

func (Boolean) ReadOnly

func (o Boolean) ReadOnly() bool

func (Boolean) Title

func (o Boolean) Title() string

type ByKey

type ByKey []Header

func (ByKey) Len

func (a ByKey) Len() int

func (ByKey) Less

func (a ByKey) Less(i, j int) bool

func (ByKey) Swap

func (a ByKey) Swap(i, j int)

type ByTitle

type ByTitle []Schema

func (ByTitle) Len

func (a ByTitle) Len() int

func (ByTitle) Less

func (a ByTitle) Less(i, j int) bool

func (ByTitle) Swap

func (a ByTitle) Swap(i, j int)

type Context

type Context struct {
	Key         string
	Raw         *schema.Schema
	Validations map[string]bool
}

func (*Context) AddValidation

func (ctx *Context) AddValidation(v validations.Validation)

func (*Context) RequiredValidations

func (ctx *Context) RequiredValidations() []string
type Header struct {
	Key, Value string
}

type Integer

type Integer struct {
	*schema.Schema
	NativeType string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Validations []validations.Validation
	// contains filtered or unexported fields
}

func NewInteger

func NewInteger(ctx *Context, s *schema.Schema) *Integer

func (Integer) Example

func (o Integer) Example(withoutReadOnly bool) interface{}

func (Integer) ExampleString

func (o Integer) ExampleString() string

func (Integer) Format

func (o Integer) Format() string

func (Integer) Key

func (o Integer) Key() string

func (Integer) MarshalJSON

func (o Integer) MarshalJSON() ([]byte, error)

func (Integer) Raw

func (o Integer) Raw() *schema.Schema

func (Integer) ReadOnly

func (o Integer) ReadOnly() bool

func (Integer) Title

func (o Integer) Title() string

type ItemSpec

type ItemSpec struct {
	*schema.ItemSpec
	Schemas []Schema
}
type Link struct {
	hschema.Link
	Description   string
	URL           *url.URL
	Title         string
	Method        string
	UrlParameters []Schema
	Schema        Schema
	TargetSchema  Schema
}
func NewLink(l *hschema.Link, s, ts Schema, r *Root, us []Schema) (*Link, error)

func (Link) MarshalJSON

func (o Link) MarshalJSON() ([]byte, error)

func (Link) ReqBody

func (l Link) ReqBody() string

func (Link) ReqHeaders

func (l Link) ReqHeaders() []Header

func (Link) ResBody

func (l Link) ResBody() string

func (Link) ResHeaders

func (l Link) ResHeaders() []Header

func (Link) ResReasonPhrase

func (l Link) ResReasonPhrase() string

func (Link) ResStatusCode

func (l Link) ResStatusCode() int
type LinkList []*Link

type Number

type Number struct {
	*schema.Schema
	NativeType string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Validations []validations.Validation
	// contains filtered or unexported fields
}

func NewNumber

func NewNumber(ctx *Context, s *schema.Schema) *Number

func (Number) Example

func (o Number) Example(withoutReadOnly bool) interface{}

func (Number) ExampleString

func (o Number) ExampleString() string

func (Number) Format

func (o Number) Format() string

func (Number) Key

func (o Number) Key() string

func (Number) MarshalJSON

func (o Number) MarshalJSON() ([]byte, error)

func (Number) Raw

func (o Number) Raw() *schema.Schema

func (Number) ReadOnly

func (o Number) ReadOnly() bool

func (Number) Title

func (o Number) Title() string

type Object

type Object struct {
	*schema.Schema
	NativeType string
	TableName  string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Required    []string
	Reference   string
	Validations []validations.Validation
	Properties  []Schema
	// contains filtered or unexported fields
}

func NewObject

func NewObject(ctx *Context, s *schema.Schema) *Object

func (Object) Example

func (o Object) Example(withoutReadOnly bool) interface{}

func (Object) ExampleString

func (o Object) ExampleString() string

func (Object) Format

func (o Object) Format() string

func (Object) Key

func (o Object) Key() string

func (Object) MarshalJSON

func (o Object) MarshalJSON() ([]byte, error)

func (Object) Raw

func (o Object) Raw() *schema.Schema

func (Object) ReadOnly

func (o Object) ReadOnly() bool

func (Object) Title

func (o Object) Title() string

type Root

type Root struct {
	*hschema.HyperSchema
	URL                 *url.URL
	Links               LinkList
	Definitions         []Schema
	Properties          []Schema
	Objects             []*Object
	Arrays              []*Array
	Strings             []*String
	Numbers             []*Number
	Integers            []*Integer
	Booleans            []*Boolean
	RequiredValidations []string
}

func NewRoot

func NewRoot(hs *hschema.HyperSchema) (*Root, error)

func (Root) MarshalJSON

func (r Root) MarshalJSON() ([]byte, error)

func (Root) Title

func (r Root) Title() string

type Schema

type Schema interface {
	Title() string
	Key() string
	ReadOnly() bool
	Example(withoutReadOnly bool) interface{}
}

type SchemasByKey

type SchemasByKey []Schema

func (SchemasByKey) Len

func (a SchemasByKey) Len() int

func (SchemasByKey) Less

func (a SchemasByKey) Less(i, j int) bool

func (SchemasByKey) Swap

func (a SchemasByKey) Swap(i, j int)

type String

type String struct {
	*schema.Schema
	NativeType string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Validations []validations.Validation
	// contains filtered or unexported fields
}

func NewString

func NewString(ctx *Context, s *schema.Schema) *String

func (String) Example

func (o String) Example(withoutReadOnly bool) interface{}

func (String) ExampleString

func (o String) ExampleString() string

func (String) Format

func (o String) Format() string

func (String) Key

func (o String) Key() string

func (String) MarshalJSON

func (s String) MarshalJSON() ([]byte, error)

func (String) Raw

func (o String) Raw() *schema.Schema

func (String) ReadOnly

func (o String) ReadOnly() bool

func (String) Title

func (o String) Title() string

type Undefined

type Undefined struct {
	Schema     *schema.Schema
	NativeType string
	ColumnName string
	ColumnType string
	Type       string
	Name       string

	Private     bool
	Validations []validations.Validation
	// contains filtered or unexported fields
}

func NewUndefined

func NewUndefined(ctx *Context, s *schema.Schema) *Undefined

func (Undefined) Description

func (o Undefined) Description() string

func (Undefined) Example

func (o Undefined) Example(withoutReadOnly bool) interface{}

func (Undefined) ExampleString

func (o Undefined) ExampleString() string

func (Undefined) Key

func (o Undefined) Key() string

func (Undefined) Raw

func (o Undefined) Raw() *schema.Schema

func (Undefined) ReadOnly

func (o Undefined) ReadOnly() bool

func (Undefined) Title

func (o Undefined) Title() string

Jump to

Keyboard shortcuts

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