Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMutlipleOps = errors.New("Only one Op attribute is allowed per method.") ErrMutlipleParms = errors.New("Only one Parm attribute is allowed per method parameter.") ErrParmInDataType = errors.New("Parm.In should be a string with value query, header, path, formData, or body.") ErrParmRequiredDataType = errors.New("Parm.Required should be a bool.") ErrParmFormatDataType = errors.New("Parm.Format should be a string with value csv, ssv, tsv, pipes, or multi.") ErrParmNameDataType = errors.New("Parm.Name should be a string.") ErrOpDeprecatedDataType = errors.New("Op.Deprecated should be a bool.") ErrOpHideDataType = errors.New("Op.Hide should be a bool.") ErrOpPathDataType = errors.New("Op.Path should be a string.") ErrOpMethodDataType = errors.New("Op.Method should be a string with value GET, PUT, POST, DELETE, OPTIONS, HEAD, or PATCH.") ErrResponseCodeDataType = errors.New("Response.Code should be an int.") ErrResponseTypeDataType = errors.New("Response.Type should be a string with a valid Babel type.") ErrResponseDescDataType = errors.New("Response.Desc should be a string.") ErrResponseHeadersDataType = errors.New("Response.Headers should be a string containing a comma-separated list of header names.") ErrHeaderTypeDataType = errors.New("Header.Type should be a string with a valid Babel type.") ErrHeaderDescDataType = errors.New("Header.Desc should be a string.") ErrHeaderFormatDataType = errors.New("Header.Format should be a string with value csv, ssv, tsv, pipes, or multi.") ErrHeaderNameDataType = errors.New("Header.Name should be a string.") ErrHeaderNameRequired = errors.New("Header.Name is required.") ErrHeaderTypeRequired = errors.New("Header.Type is required.") ErrResponseCodeRequired = errors.New("Response.Code is required.") )
Error definitions
Functions ¶
Types ¶
type Header ¶
type Header struct { Type *idl.Type // Header type Desc string // Description Format ListFmt // format of list parameters }
Defines an HTTP header
type HttpMethod ¶
type HttpMethod int
HTTP methods
const ( GET HttpMethod = iota PUT POST DELETE OPTIONS HEAD PATCH )
func (HttpMethod) String ¶
func (i HttpMethod) String() string
type ListFmt ¶
type ListFmt int
List format
const ( NONE ListFmt = iota // Not applicable CSV // comma separated values foo,bar SSV // space separated values foo bar TSV // tab separated values foo\tbar PIPES // pipe separated values foo|bar MULTI // corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in "query" or "formData" )
type Operation ¶
type Operation struct { Path string // API path Method HttpMethod // HTTP method Deprecated bool // whether the API is deprecated Responses map[int]Response // Response that can occur Hide bool // Don't expose this operation from tools }
Operation defines a RESTful operation
type Parm ¶
type Parm struct { In ParmIn // where the parameter comes from Required bool // whether it is required Format ListFmt // format of list parameters Name string // used to rename (usually for headers) }
Defines a parameter
Click to show internal directories.
Click to hide internal directories.