Documentation
¶
Index ¶
- Constants
- func DisableWarningLogger()
- func EnableWarningLogger()
- func GenerateApib() ([]byte, error)
- func GenerateSwaggerJson() ([]byte, error)
- func GenerateSwaggerYaml() ([]byte, error)
- func GetBasePath() string
- func GetHost() string
- func SaveApib(path string) ([]byte, error)
- func SaveSwaggerJson(path string) ([]byte, error)
- func SaveSwaggerYaml(path string) ([]byte, error)
- type Contact
- type Definition
- func (d *Definition) AddProperties(properties ...*Property) *Definition
- func (d *Definition) Desc(desc string) *Definition
- func (d *Definition) Generics(generics ...string) *Definition
- func (d *Definition) GetDesc() string
- func (d *Definition) GetGenerics() []string
- func (d *Definition) GetName() string
- func (d *Definition) GetProperties() []*Property
- func (d *Definition) GetXMLRepr() *XMLRepr
- func (d *Definition) Name(name string) *Definition
- func (d *Definition) Properties(properties ...*Property) *Definition
- func (d *Definition) XMLRepr(repr *XMLRepr) *Definition
- type Document
- func AddDefinitions(definitions ...*Definition) *Document
- func AddOperations(operations ...*Operation) *Document
- func CleanupDocument() *Document
- func NewDocument(host, basePath string, info *Info) *Document
- func SetBasePath(basePath string) *Document
- func SetDefinitions(definitions ...*Definition) *Document
- func SetDocument(host, basePath string, info *Info) *Document
- func SetHost(host string) *Document
- func SetInfo(info *Info) *Document
- func SetOperations(operations ...*Operation) *Document
- func SetOption(option *Option) *Document
- func (d *Document) AddDefinitions(definitions ...*Definition) *Document
- func (d *Document) AddOperations(operations ...*Operation) *Document
- func (d *Document) BasePath(basePath string) *Document
- func (d *Document) Cleanup() *Document
- func (d *Document) Definitions(definitions ...*Definition) *Document
- func (d *Document) GenerateApib() ([]byte, error)
- func (d *Document) GenerateSwaggerJson() ([]byte, error)
- func (d *Document) GenerateSwaggerYaml() ([]byte, error)
- func (d *Document) GetBasePath() string
- func (d *Document) GetDefinitions() []*Definition
- func (d *Document) GetHost() string
- func (d *Document) GetInfo() *Info
- func (d *Document) GetOperations() []*Operation
- func (d *Document) GetOption() *Option
- func (d *Document) Host(host string) *Document
- func (d *Document) Info(info *Info) *Document
- func (d *Document) Operations(operations ...*Operation) *Document
- func (d *Document) Option(option *Option) *Document
- func (d *Document) SaveApib(path string) ([]byte, error)
- func (d *Document) SaveSwaggerJson(path string) ([]byte, error)
- func (d *Document) SaveSwaggerYaml(path string) ([]byte, error)
- type ExternalDoc
- type Info
- func (i *Info) Contact(contact *Contact) *Info
- func (i *Info) Desc(desc string) *Info
- func (i *Info) GetContact() *Contact
- func (i *Info) GetDesc() string
- func (i *Info) GetLicense() *License
- func (i *Info) GetTermsOfService() string
- func (i *Info) GetTitle() string
- func (i *Info) GetVersion() string
- func (i *Info) License(license *License) *Info
- func (i *Info) TermsOfService(terms string) *Info
- func (i *Info) Title(title string) *Info
- func (i *Info) Version(version string) *Info
- type ItemOption
- func (o *ItemOption) AllowEmpty(allow bool) *ItemOption
- func (o *ItemOption) CollectionFormat(collectionFormat string) *ItemOption
- func (o *ItemOption) Default(defaul interface{}) *ItemOption
- func (o *ItemOption) Enum(enums ...interface{}) *ItemOption
- func (o *ItemOption) Example(example interface{}) *ItemOption
- func (o *ItemOption) ExclusiveMax(exclusiveMax bool) *ItemOption
- func (o *ItemOption) ExclusiveMin(exclusiveMin bool) *ItemOption
- func (o *ItemOption) GetAllowEmpty() bool
- func (o *ItemOption) GetCollectionFormat() string
- func (o *ItemOption) GetDefault() interface{}
- func (o *ItemOption) GetEnum() []interface{}
- func (o *ItemOption) GetExample() interface{}
- func (o *ItemOption) GetExclusiveMax() bool
- func (o *ItemOption) GetExclusiveMin() bool
- func (o *ItemOption) GetItemOption() *ItemOption
- func (o *ItemOption) GetMaxItems() *int
- func (o *ItemOption) GetMaxLength() *int
- func (o *ItemOption) GetMaximum() *float64
- func (o *ItemOption) GetMinItems() *int
- func (o *ItemOption) GetMinLength() *int
- func (o *ItemOption) GetMinimum() *float64
- func (o *ItemOption) GetMultipleOf() float64
- func (o *ItemOption) GetPattern() string
- func (o *ItemOption) GetUniqueItems() bool
- func (o *ItemOption) GetXMLRepr() *XMLRepr
- func (o *ItemOption) ItemOption(itemOption *ItemOption) *ItemOption
- func (o *ItemOption) ItemsRange(min, max int) *ItemOption
- func (o *ItemOption) LengthRange(min, max int) *ItemOption
- func (o *ItemOption) MaxItems(max int) *ItemOption
- func (o *ItemOption) MaxLength(max int) *ItemOption
- func (o *ItemOption) Maximum(max float64) *ItemOption
- func (o *ItemOption) MinItems(min int) *ItemOption
- func (o *ItemOption) MinLength(min int) *ItemOption
- func (o *ItemOption) Minimum(min float64) *ItemOption
- func (o *ItemOption) MultipleOf(multipleOf float64) *ItemOption
- func (o *ItemOption) Pattern(pattern string) *ItemOption
- func (o *ItemOption) UniqueItems(unique bool) *ItemOption
- func (o *ItemOption) ValueRange(min, max float64) *ItemOption
- func (o *ItemOption) XMLRepr(repr *XMLRepr) *ItemOption
- type License
- type Operation
- func GetOperations() []*Operation
- func NewDeleteOperation(route, summary string) *Operation
- func NewGetOperation(route, summary string) *Operation
- func NewHeadOperation(route, summary string) *Operation
- func NewOperation(method, route, summary string) *Operation
- func NewOptionsOperation(route, summary string) *Operation
- func NewPatchOperation(route, summary string) *Operation
- func NewPostOperation(route, summary string) *Operation
- func NewPutOperation(route, summary string) *Operation
- func (o *Operation) AddConsumes(consumes ...string) *Operation
- func (o *Operation) AddParams(params ...*Param) *Operation
- func (o *Operation) AddProduces(produces ...string) *Operation
- func (o *Operation) AddResponses(responses ...*Response) *Operation
- func (o *Operation) AddSchemes(schemes ...string) *Operation
- func (o *Operation) AddSecurities(securities ...string) *Operation
- func (o *Operation) AddTags(tags ...string) *Operation
- func (o *Operation) AdditionalDoc(doc string) *Operation
- func (o *Operation) Consumes(consumes ...string) *Operation
- func (o *Operation) Deprecated(deprecated bool) *Operation
- func (o *Operation) Desc(desc string) *Operation
- func (o *Operation) ExternalDoc(doc *ExternalDoc) *Operation
- func (o *Operation) GetAdditionalDoc() string
- func (o *Operation) GetConsumes() []string
- func (o *Operation) GetDeprecated() bool
- func (o *Operation) GetDesc() string
- func (o *Operation) GetExternalDoc() *ExternalDoc
- func (o *Operation) GetMethod() string
- func (o *Operation) GetOperationId() string
- func (o *Operation) GetParams() []*Param
- func (o *Operation) GetProduces() []string
- func (o *Operation) GetRequestExample() interface{}
- func (o *Operation) GetResponses() []*Response
- func (o *Operation) GetRoute() string
- func (o *Operation) GetSchemes() []string
- func (o *Operation) GetSecurities() []string
- func (o *Operation) GetSecuritiesScopes() map[string][]string
- func (o *Operation) GetSummary() string
- func (o *Operation) GetTags() []string
- func (o *Operation) Method(method string) *Operation
- func (o *Operation) OperationId(operationId string) *Operation
- func (o *Operation) Params(params ...*Param) *Operation
- func (o *Operation) Produces(produces ...string) *Operation
- func (o *Operation) RequestExample(reqExample interface{}) *Operation
- func (o *Operation) Responses(responses ...*Response) *Operation
- func (o *Operation) Route(route string) *Operation
- func (o *Operation) Schemes(schemes ...string) *Operation
- func (o *Operation) Securities(securities ...string) *Operation
- func (o *Operation) SetSecurityScopes(security string, scopes ...string) *Operation
- func (o *Operation) Summary(summary string) *Operation
- func (o *Operation) Tags(tags ...string) *Operation
- type Option
- func (o *Option) AddConsumes(consumes ...string) *Option
- func (o *Option) AddGlobalParams(globalParams ...*Param) *Option
- func (o *Option) AddProduces(produces ...string) *Option
- func (o *Option) AddRoutesOptions(options ...*RoutesOption) *Option
- func (o *Option) AddSchemes(schemes ...string) *Option
- func (o *Option) AddSecurities(securities ...*Security) *Option
- func (o *Option) AddTags(tags ...*Tag) *Option
- func (o *Option) AdditionalDoc(doc string) *Option
- func (o *Option) Consumes(consumes ...string) *Option
- func (o *Option) ExternalDoc(doc *ExternalDoc) *Option
- func (o *Option) GetAdditionalDoc() string
- func (o *Option) GetConsumes() []string
- func (o *Option) GetExternalDoc() *ExternalDoc
- func (o *Option) GetGlobalParams() []*Param
- func (o *Option) GetProduces() []string
- func (o *Option) GetRoutesOptions() []*RoutesOption
- func (o *Option) GetSchemes() []string
- func (o *Option) GetSecurities() []*Security
- func (o *Option) GetTags() []*Tag
- func (o *Option) GlobalParams(globalParams ...*Param) *Option
- func (o *Option) Produces(produces ...string) *Option
- func (o *Option) RoutesOptions(options ...*RoutesOption) *Option
- func (o *Option) Schemes(schemes ...string) *Option
- func (o *Option) Securities(securities ...*Security) *Option
- func (o *Option) Tags(tags ...*Tag) *Option
- type Param
- func NewBodyParam(name, typ string, required bool, desc string) *Param
- func NewFormParam(name, typ string, required bool, desc string) *Param
- func NewHeaderParam(name, typ string, required bool, desc string) *Param
- func NewParam(name, in, typ string, required bool, desc string) *Param
- func NewPathParam(name, typ string, required bool, desc string) *Param
- func NewQueryParam(name, typ string, required bool, desc string) *Param
- func (p *Param) AllowEmpty(allow bool) *Param
- func (p *Param) CollectionFormat(collectionFormat string) *Param
- func (p *Param) Default(defaul interface{}) *Param
- func (p *Param) Desc(desc string) *Param
- func (p *Param) Enum(enums ...interface{}) *Param
- func (p *Param) Example(example interface{}) *Param
- func (p *Param) ExclusiveMax(exclusiveMax bool) *Param
- func (p *Param) ExclusiveMin(exclusiveMin bool) *Param
- func (p *Param) GetAllowEmpty() bool
- func (p *Param) GetCollectionFormat() string
- func (p *Param) GetDefault() interface{}
- func (p *Param) GetDesc() string
- func (p *Param) GetEnum() []interface{}
- func (p *Param) GetExample() interface{}
- func (p *Param) GetExclusiveMax() bool
- func (p *Param) GetExclusiveMin() bool
- func (p *Param) GetInLoc() string
- func (p *Param) GetItemOption() *ItemOption
- func (p *Param) GetMaxItems() *int
- func (p *Param) GetMaxLength() *int
- func (p *Param) GetMaximum() *float64
- func (p *Param) GetMinItems() *int
- func (p *Param) GetMinLength() *int
- func (p *Param) GetMinimum() *float64
- func (p *Param) GetMultipleOf() float64
- func (p *Param) GetName() string
- func (p *Param) GetPattern() string
- func (p *Param) GetRequired() bool
- func (p *Param) GetType() string
- func (p *Param) GetUniqueItems() bool
- func (p *Param) GetXMLRepr() *XMLRepr
- func (p *Param) InLoc(in string) *Param
- func (p *Param) ItemOption(itemOption *ItemOption) *Param
- func (p *Param) ItemsRange(min, max int) *Param
- func (p *Param) LengthRange(min, max int) *Param
- func (p *Param) MaxItems(max int) *Param
- func (p *Param) MaxLength(max int) *Param
- func (p *Param) Maximum(max float64) *Param
- func (p *Param) MinItems(min int) *Param
- func (p *Param) MinLength(min int) *Param
- func (p *Param) Minimum(min float64) *Param
- func (p *Param) MultipleOf(multipleOf float64) *Param
- func (p *Param) Name(name string) *Param
- func (p *Param) Pattern(pattern string) *Param
- func (p *Param) Required(required bool) *Param
- func (p *Param) Type(typ string) *Param
- func (p *Param) UniqueItems(unique bool) *Param
- func (p *Param) ValueRange(min, max float64) *Param
- func (p *Param) XMLRepr(repr *XMLRepr) *Param
- type Property
- func (p *Property) AllowEmpty(allow bool) *Property
- func (p *Property) CollectionFormat(collectionFormat string) *Property
- func (p *Property) Default(defaul interface{}) *Property
- func (p *Property) Desc(desc string) *Property
- func (p *Property) Enum(enums ...interface{}) *Property
- func (p *Property) Example(example interface{}) *Property
- func (p *Property) ExclusiveMax(exclusiveMax bool) *Property
- func (p *Property) ExclusiveMin(exclusiveMin bool) *Property
- func (p *Property) GetAllowEmpty() bool
- func (p *Property) GetCollectionFormat() string
- func (p *Property) GetDefault() interface{}
- func (p *Property) GetDesc() string
- func (p *Property) GetEnum() []interface{}
- func (p *Property) GetExample() interface{}
- func (p *Property) GetExclusiveMax() bool
- func (p *Property) GetExclusiveMin() bool
- func (p *Property) GetItemOption() *ItemOption
- func (p *Property) GetMaxItems() *int
- func (p *Property) GetMaxLength() *int
- func (p *Property) GetMaximum() *float64
- func (p *Property) GetMinItems() *int
- func (p *Property) GetMinLength() *int
- func (p *Property) GetMinimum() *float64
- func (p *Property) GetMultipleOf() float64
- func (p *Property) GetName() string
- func (p *Property) GetPattern() string
- func (p *Property) GetRequired() bool
- func (p *Property) GetType() string
- func (p *Property) GetUniqueItems() bool
- func (p *Property) GetXMLRepr() *XMLRepr
- func (p *Property) ItemOption(itemOption *ItemOption) *Property
- func (p *Property) ItemsRange(min, max int) *Property
- func (p *Property) LengthRange(min, max int) *Property
- func (p *Property) MaxItems(max int) *Property
- func (p *Property) MaxLength(max int) *Property
- func (p *Property) Maximum(max float64) *Property
- func (p *Property) MinItems(min int) *Property
- func (p *Property) MinLength(min int) *Property
- func (p *Property) Minimum(min float64) *Property
- func (p *Property) MultipleOf(multipleOf float64) *Property
- func (p *Property) Name(name string) *Property
- func (p *Property) Pattern(pattern string) *Property
- func (p *Property) Required(required bool) *Property
- func (p *Property) Type(typ string) *Property
- func (p *Property) UniqueItems(unique bool) *Property
- func (p *Property) ValueRange(min, max float64) *Property
- func (p *Property) XMLRepr(repr *XMLRepr) *Property
- type Response
- func (r *Response) AddExamples(examples ...*ResponseExample) *Response
- func (r *Response) AddHeaders(headers ...*ResponseHeader) *Response
- func (r *Response) AdditionalDoc(doc string) *Response
- func (r *Response) Code(code int) *Response
- func (r *Response) Desc(desc string) *Response
- func (r *Response) Examples(examples ...*ResponseExample) *Response
- func (r *Response) GetAdditionalDoc() string
- func (r *Response) GetCode() int
- func (r *Response) GetDesc() string
- func (r *Response) GetExamples() []*ResponseExample
- func (r *Response) GetHeaders() []*ResponseHeader
- func (r *Response) GetType() string
- func (r *Response) Headers(headers ...*ResponseHeader) *Response
- func (r *Response) Type(typ string) *Response
- type ResponseExample
- type ResponseHeader
- func (h *ResponseHeader) Desc(desc string) *ResponseHeader
- func (h *ResponseHeader) Example(example interface{}) *ResponseHeader
- func (h *ResponseHeader) GetDesc() string
- func (h *ResponseHeader) GetExample() interface{}
- func (h *ResponseHeader) GetName() string
- func (h *ResponseHeader) GetType() string
- func (h *ResponseHeader) Name(name string) *ResponseHeader
- func (h *ResponseHeader) Type(typ string) *ResponseHeader
- type RoutesOption
- func (r *RoutesOption) AdditionalDoc(additionalDoc string) *RoutesOption
- func (r *RoutesOption) GetAdditionalDoc() string
- func (r *RoutesOption) GetRoute() string
- func (r *RoutesOption) GetSummary() string
- func (r *RoutesOption) Route(route string) *RoutesOption
- func (r *RoutesOption) Summary(summary string) *RoutesOption
- type Security
- func (s *Security) AddScopes(scopes ...*SecurityScope) *Security
- func (s *Security) AuthorizationUrl(authorizationUrl string) *Security
- func (s *Security) Desc(desc string) *Security
- func (s *Security) Flow(flow string) *Security
- func (s *Security) GetAuthorizationUrl() string
- func (s *Security) GetDesc() string
- func (s *Security) GetFlow() string
- func (s *Security) GetInLoc() string
- func (s *Security) GetName() string
- func (s *Security) GetScopes() []*SecurityScope
- func (s *Security) GetTitle() string
- func (s *Security) GetTokenUrl() string
- func (s *Security) GetType() string
- func (s *Security) InLoc(in string) *Security
- func (s *Security) Name(name string) *Security
- func (s *Security) Scopes(scopes ...*SecurityScope) *Security
- func (s *Security) Title(title string) *Security
- func (s *Security) TokenUrl(tokenUrl string) *Security
- func (s *Security) Type(typ string) *Security
- type SecurityScope
- type Tag
- func (t *Tag) AdditionalDoc(doc string) *Tag
- func (t *Tag) Desc(desc string) *Tag
- func (t *Tag) ExternalDoc(doc *ExternalDoc) *Tag
- func (t *Tag) GetAdditionalDoc() string
- func (t *Tag) GetDesc() string
- func (t *Tag) GetExternalDoc() *ExternalDoc
- func (t *Tag) GetName() string
- func (t *Tag) Name(name string) *Tag
- type XMLRepr
- func (x *XMLRepr) Attribute(attribute bool) *XMLRepr
- func (x *XMLRepr) GetAttribute() bool
- func (x *XMLRepr) GetName() string
- func (x *XMLRepr) GetNamespace() string
- func (x *XMLRepr) GetPrefix() string
- func (x *XMLRepr) GetWrapped() bool
- func (x *XMLRepr) Name(name string) *XMLRepr
- func (x *XMLRepr) Namespace(namespace string) *XMLRepr
- func (x *XMLRepr) Prefix(prefix string) *XMLRepr
- func (x *XMLRepr) Wrapped(wrapped bool) *XMLRepr
Constants ¶
const ( BASIC = "basic" // BASIC security type: basic authentication APIKEY = "apiKey" // APIKEY security type: api key authentication OAUTH2 = "oauth2" // OAUTH2 security type: oauth2 authentication )
security type
const ( IMPLICIT_FLOW = "implicit" // IMPLICIT_FLOW oauth2 flow: implicit PASSWORD_FLOW = "password" // PASSWORD_FLOW oauth2 flow: password APPLICATION_FLOW = "application" // APPLICATION_FLOW oauth2 flow: application ACCESSCODE_FLOW = "accessCode" // ACCESSCODE_FLOW oauth2 flow: accessCode )
oauth2 flow
const ( INTEGER = "integer" // INTEGER type: integer, long NUMBER = "number" // NUMBER type: float, double STRING = "string" // STRING type: string, byte, binary, date, dateTime, password BOOLEAN = "boolean" // BOOLEAN type: boolean ARRAY = "array" // ARRAY type: array FILE = "file" // FILE type: file OBJECT = "object" // OBJECT type: object )
type
const ( INT32 = "int32" // INT32 format: signed 32 bits INT64 = "int64" // INT64 format: signed 64 bits FLOAT = "float" // FLOAT format: float DOUBLE = "double" // DOUBLE format: double BYTE = "byte" // BYTE format: base64 encoded characters BINARY = "binary" // BINARY format: any sequence of octets DATE = "date" // DATE format: As defined by full-date - RFC3339 DATETIME = "date-time" // DATETIME format: As defined by date-time - RFC3339 PASSWORD = "password" // PASSWORD format: Used to hint UIs the input needs to be obscured )
format
const ( QUERY = "query" // QUERY param PATH = "path" // PATH param HEADER = "header" // HEADER param BODY = "body" // BODY param FORM = "formData" // FORM param )
param
const ( GET = "get" // GET method PUT = "put" // PUT method POST = "post" // POST method DELETE = "delete" // DELETE method OPTIONS = "options" // OPTIONS method HEAD = "head" // HEAD method PATCH = "patch" // PATCH method )
method
const ( ALL = "*/*" // ALL mime data: */* JSON = "application/json" // JSON mime data: application/json XML = "application/xml" // XML mime data: application/xml PLAIN = "text/plain" // PLAIN mime data: text/plain HTML = "text/html" // HTML mime data: text/html MPFD = "multipart/form-data" // MPFD mime data: multipart/form-data URL = "application/x-www-form-urlencoded" // URL mime data: application/x-www-form-urlencoded PNG = "image/png" // PNG mime data: image/png JPEG = "image/jpeg" // JPEG mime data: image/jpeg GIF = "image/gif" // GIF mime data: image/gif )
mime
const ( CSV = "csv" // CSV collection format: foo,bar SSV = "ssv" // SSV collection format: foo bar TSV = "tsv" // TSV collection format: foo\tbar PIPES = "pipes" // PIPES collection format: foo|bar MULTI = "multi" // MULTI collection format: foo=bar&foo=baz )
collection format
Variables ¶
This section is empty.
Functions ¶
func DisableWarningLogger ¶ added in v1.3.0
func DisableWarningLogger()
DisableWarningLogger disables the warning logger switcher.
func EnableWarningLogger ¶ added in v1.3.0
func EnableWarningLogger()
EnableWarningLogger enables the warning logger switcher.
func GenerateApib ¶
GenerateApib generates apib script and returns byte array.
func GenerateSwaggerJson ¶
GenerateSwaggerJson generates swagger json script and returns byte array.
func GenerateSwaggerYaml ¶
GenerateSwaggerYaml generates swagger yaml script and returns byte array.
func GetBasePath ¶ added in v1.3.0
func GetBasePath() string
GetBasePath returns the basePath from global Document.
func SaveSwaggerJson ¶ added in v1.3.0
SaveSwaggerJson generates swagger json script and saves into file.
func SaveSwaggerYaml ¶ added in v1.3.0
SaveSwaggerYaml generates swagger yaml script and saves into file.
Types ¶
type Contact ¶
type Contact struct {
// contains filtered or unexported fields
}
Contact represents a contact information of Document.
func NewContact ¶
NewContact creates a default Contact with given arguments.
type Definition ¶
type Definition struct {
// contains filtered or unexported fields
}
Definition represents an api definition information of Document.
func GetDefinitions ¶ added in v1.3.0
func GetDefinitions() []*Definition
GetDefinitions returns the whole definitions from global Document.
func NewDefinition ¶
func NewDefinition(name, desc string) *Definition
NewDefinition creates a default Definition with given arguments.
func (*Definition) AddProperties ¶ added in v1.3.0
func (d *Definition) AddProperties(properties ...*Property) *Definition
AddProperties add some properties into Definition.
func (*Definition) Desc ¶ added in v1.3.0
func (d *Definition) Desc(desc string) *Definition
Desc sets the desc in Definition.
func (*Definition) Generics ¶
func (d *Definition) Generics(generics ...string) *Definition
Generics sets the whole generics in Definition.
func (*Definition) GetDesc ¶ added in v1.3.0
func (d *Definition) GetDesc() string
GetDesc returns the desc from Definition.
func (*Definition) GetGenerics ¶ added in v1.3.0
func (d *Definition) GetGenerics() []string
GetGenerics returns the whole generics from Definition.
func (*Definition) GetName ¶ added in v1.3.0
func (d *Definition) GetName() string
GetName returns the name from Definition.
func (*Definition) GetProperties ¶ added in v1.3.0
func (d *Definition) GetProperties() []*Property
GetProperties returns the whole properties from Definition.
func (*Definition) GetXMLRepr ¶ added in v1.3.0
func (d *Definition) GetXMLRepr() *XMLRepr
GetXMLRepr returns the xml repr from Definition.
func (*Definition) Name ¶ added in v1.3.0
func (d *Definition) Name(name string) *Definition
Name sets the name in Definition.
func (*Definition) Properties ¶
func (d *Definition) Properties(properties ...*Property) *Definition
Properties sets the whole properties in Definition.
func (*Definition) XMLRepr ¶ added in v1.3.0
func (d *Definition) XMLRepr(repr *XMLRepr) *Definition
XMLRepr sets the xml repr in Definition, this is only supported in Swagger.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document represents an api document information.
func AddDefinitions ¶
func AddDefinitions(definitions ...*Definition) *Document
AddDefinitions adds some definitions into global Document.
func AddOperations ¶ added in v1.3.0
AddOperations adds some operations into global Document.
func CleanupDocument ¶ added in v1.3.0
func CleanupDocument() *Document
CleanupDocument cleans up the global Document.
func NewDocument ¶ added in v1.3.0
NewDocument creates a default Document with given arguments.
func SetBasePath ¶ added in v1.3.0
SetBasePath sets the basePath in global Document.
func SetDefinitions ¶ added in v1.3.0
func SetDefinitions(definitions ...*Definition) *Document
SetDefinitions sets the whole definitions in global Document.
func SetDocument ¶
SetDocument sets the basic information for global Document.
func SetOperations ¶ added in v1.3.0
SetOperations sets the whole operations in global Document.
func (*Document) AddDefinitions ¶
func (d *Document) AddDefinitions(definitions ...*Definition) *Document
AddDefinitions adds some definitions into Document.
func (*Document) AddOperations ¶ added in v1.3.0
AddOperations adds some operations into Document.
func (*Document) Definitions ¶ added in v1.3.0
func (d *Document) Definitions(definitions ...*Definition) *Document
Definitions sets the whole definitions in Document.
func (*Document) GenerateApib ¶
GenerateApib generates apib script and returns byte array.
func (*Document) GenerateSwaggerJson ¶
GenerateSwaggerJson generates swagger json script and returns byte array.
func (*Document) GenerateSwaggerYaml ¶
GenerateSwaggerYaml generates swagger yaml script and returns byte array.
func (*Document) GetBasePath ¶ added in v1.3.0
GetBasePath returns the basePath from Document.
func (*Document) GetDefinitions ¶ added in v1.3.0
func (d *Document) GetDefinitions() []*Definition
GetDefinitions returns the whole definitions from Document.
func (*Document) GetOperations ¶ added in v1.3.0
GetOperations returns the whole operations from Document.
func (*Document) Operations ¶ added in v1.3.0
Operations sets the whole operations in Document.
func (*Document) SaveSwaggerJson ¶ added in v1.3.0
SaveSwaggerJson generates swagger json script and saves into file.
type ExternalDoc ¶ added in v1.3.0
type ExternalDoc struct {
// contains filtered or unexported fields
}
ExternalDoc represents an external documentation information of Document, Tag and Operation.
func NewExternalDoc ¶ added in v1.3.0
func NewExternalDoc(desc, url string) *ExternalDoc
NewExternalDoc creates a default ExternalDoc with given arguments.
func (*ExternalDoc) Desc ¶ added in v1.3.0
func (e *ExternalDoc) Desc(desc string) *ExternalDoc
Desc sets the desc in ExternalDoc.
func (*ExternalDoc) GetDesc ¶ added in v1.3.0
func (e *ExternalDoc) GetDesc() string
GetDesc returns the desc from ExternalDoc.
func (*ExternalDoc) GetUrl ¶ added in v1.3.0
func (e *ExternalDoc) GetUrl() string
GetUrl returns the url from ExternalDoc.
func (*ExternalDoc) Url ¶ added in v1.3.0
func (e *ExternalDoc) Url(url string) *ExternalDoc
Url sets the url in ExternalDoc.
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
Info represents a basic information of Document.
func (*Info) GetContact ¶ added in v1.3.0
GetContact returns the contact from Info.
func (*Info) GetLicense ¶ added in v1.3.0
GetLicense returns the license from Info.
func (*Info) GetTermsOfService ¶ added in v1.3.0
GetTermsOfService returns the terms of service from Info.
func (*Info) GetVersion ¶ added in v1.3.0
GetVersion returns the version from Info.
func (*Info) TermsOfService ¶
TermsOfService sets the terms of service in Info.
type ItemOption ¶ added in v1.3.0
type ItemOption struct {
// contains filtered or unexported fields
}
ItemOption represents an array type's item option of Param, Property and ItemOption itself, this is only supported in Swagger.
func NewItemOption ¶ added in v1.3.0
func NewItemOption() *ItemOption
NewItemOption creates a default ItemOption.
func (*ItemOption) AllowEmpty ¶ added in v1.3.0
func (o *ItemOption) AllowEmpty(allow bool) *ItemOption
AllowEmpty sets the allowEmpty in ItemOption.
func (*ItemOption) CollectionFormat ¶ added in v1.3.0
func (o *ItemOption) CollectionFormat(collectionFormat string) *ItemOption
CollectionFormat sets the collectionFormat in ItemOption.
func (*ItemOption) Default ¶ added in v1.3.0
func (o *ItemOption) Default(defaul interface{}) *ItemOption
Default sets the default in ItemOption.
func (*ItemOption) Enum ¶ added in v1.3.0
func (o *ItemOption) Enum(enums ...interface{}) *ItemOption
Enum sets the whole enums in ItemOption.
func (*ItemOption) Example ¶ added in v1.3.0
func (o *ItemOption) Example(example interface{}) *ItemOption
Example sets the example in ItemOption.
func (*ItemOption) ExclusiveMax ¶ added in v1.3.0
func (o *ItemOption) ExclusiveMax(exclusiveMax bool) *ItemOption
ExclusiveMax sets the exclusiveMax in ItemOption.
func (*ItemOption) ExclusiveMin ¶ added in v1.3.0
func (o *ItemOption) ExclusiveMin(exclusiveMin bool) *ItemOption
ExclusiveMin sets the exclusiveMin in ItemOption.
func (*ItemOption) GetAllowEmpty ¶ added in v1.3.0
func (o *ItemOption) GetAllowEmpty() bool
GetAllowEmpty returns the allowEmpty from ItemOption.
func (*ItemOption) GetCollectionFormat ¶ added in v1.3.0
func (o *ItemOption) GetCollectionFormat() string
GetCollectionFormat returns the collectionFormat from ItemOption.
func (*ItemOption) GetDefault ¶ added in v1.3.0
func (o *ItemOption) GetDefault() interface{}
GetDefault returns the default from ItemOption.
func (*ItemOption) GetEnum ¶ added in v1.3.0
func (o *ItemOption) GetEnum() []interface{}
GetEnum returns the enum from ItemOption.
func (*ItemOption) GetExample ¶ added in v1.3.0
func (o *ItemOption) GetExample() interface{}
GetExample returns the example from ItemOption.
func (*ItemOption) GetExclusiveMax ¶ added in v1.3.0
func (o *ItemOption) GetExclusiveMax() bool
GetExclusiveMax returns the exclusiveMax from ItemOption.
func (*ItemOption) GetExclusiveMin ¶ added in v1.3.0
func (o *ItemOption) GetExclusiveMin() bool
GetExclusiveMin returns the exclusiveMin from ItemOption.
func (*ItemOption) GetItemOption ¶ added in v1.3.0
func (o *ItemOption) GetItemOption() *ItemOption
GetItemOption returns the itemOption from ItemOption.
func (*ItemOption) GetMaxItems ¶ added in v1.3.0
func (o *ItemOption) GetMaxItems() *int
GetMaxItems returns the maxItems from ItemOption.
func (*ItemOption) GetMaxLength ¶ added in v1.3.0
func (o *ItemOption) GetMaxLength() *int
GetMaxLength returns the maxLength from ItemOption.
func (*ItemOption) GetMaximum ¶ added in v1.3.0
func (o *ItemOption) GetMaximum() *float64
GetMaximum returns the maximum from ItemOption.
func (*ItemOption) GetMinItems ¶ added in v1.3.0
func (o *ItemOption) GetMinItems() *int
GetMinItems returns the minItems from ItemOption.
func (*ItemOption) GetMinLength ¶ added in v1.3.0
func (o *ItemOption) GetMinLength() *int
GetMinLength returns the minLength from ItemOption.
func (*ItemOption) GetMinimum ¶ added in v1.3.0
func (o *ItemOption) GetMinimum() *float64
GetMinimum returns the minimum from ItemOption.
func (*ItemOption) GetMultipleOf ¶ added in v1.3.0
func (o *ItemOption) GetMultipleOf() float64
GetMultipleOf returns the multipleOf from ItemOption.
func (*ItemOption) GetPattern ¶ added in v1.3.0
func (o *ItemOption) GetPattern() string
GetPattern returns the pattern from ItemOption.
func (*ItemOption) GetUniqueItems ¶ added in v1.3.0
func (o *ItemOption) GetUniqueItems() bool
GetUniqueItems returns the uniqueItems from ItemOption.
func (*ItemOption) GetXMLRepr ¶ added in v1.3.0
func (o *ItemOption) GetXMLRepr() *XMLRepr
GetXMLRepr returns the xmlRepr from ItemOption.
func (*ItemOption) ItemOption ¶ added in v1.3.0
func (o *ItemOption) ItemOption(itemOption *ItemOption) *ItemOption
ItemOption sets the item option in ItemOption, this is only supported in Swagger.
func (*ItemOption) ItemsRange ¶ added in v1.3.0
func (o *ItemOption) ItemsRange(min, max int) *ItemOption
ItemsRange sets the minItems and maxItems in ItemOption.
func (*ItemOption) LengthRange ¶ added in v1.3.0
func (o *ItemOption) LengthRange(min, max int) *ItemOption
LengthRange sets the minLength and maxLength in ItemOption.
func (*ItemOption) MaxItems ¶ added in v1.3.0
func (o *ItemOption) MaxItems(max int) *ItemOption
MaxItems sets the maxItems in ItemOption.
func (*ItemOption) MaxLength ¶ added in v1.3.0
func (o *ItemOption) MaxLength(max int) *ItemOption
MaxLength sets the maxLength in ItemOption.
func (*ItemOption) Maximum ¶ added in v1.3.0
func (o *ItemOption) Maximum(max float64) *ItemOption
Maximum sets the maximum in ItemOption.
func (*ItemOption) MinItems ¶ added in v1.3.0
func (o *ItemOption) MinItems(min int) *ItemOption
MinItems sets the minItems in ItemOption.
func (*ItemOption) MinLength ¶ added in v1.3.0
func (o *ItemOption) MinLength(min int) *ItemOption
MinLength sets the minLength in ItemOption.
func (*ItemOption) Minimum ¶ added in v1.3.0
func (o *ItemOption) Minimum(min float64) *ItemOption
Minimum sets the minimum in ItemOption.
func (*ItemOption) MultipleOf ¶ added in v1.3.0
func (o *ItemOption) MultipleOf(multipleOf float64) *ItemOption
MultipleOf sets the multipleOf in ItemOption.
func (*ItemOption) Pattern ¶ added in v1.3.0
func (o *ItemOption) Pattern(pattern string) *ItemOption
Pattern sets the pattern in ItemOption.
func (*ItemOption) UniqueItems ¶ added in v1.3.0
func (o *ItemOption) UniqueItems(unique bool) *ItemOption
UniqueItems sets the uniqueItems in ItemOption.
func (*ItemOption) ValueRange ¶ added in v1.3.0
func (o *ItemOption) ValueRange(min, max float64) *ItemOption
ValueRange sets the minimum and maximum in ItemOption.
func (*ItemOption) XMLRepr ¶ added in v1.3.0
func (o *ItemOption) XMLRepr(repr *XMLRepr) *ItemOption
XMLRepr sets the xml repr in ItemOption, this is only supported in Swagger.
type License ¶
type License struct {
// contains filtered or unexported fields
}
License represents a license information of Document.
func NewLicense ¶
NewLicense creates a default License with given arguments.
type Operation ¶ added in v1.3.0
type Operation struct {
// contains filtered or unexported fields
}
Operation represents an api operation information of Document.
func GetOperations ¶ added in v1.3.0
func GetOperations() []*Operation
GetOperations returns the whole operations from global Document.
func NewDeleteOperation ¶ added in v1.3.0
NewDeleteOperation creates a delete Operation with given arguments.
func NewGetOperation ¶ added in v1.3.0
NewGetOperation creates a get Operation with given arguments.
func NewHeadOperation ¶ added in v1.3.0
NewHeadOperation creates a head Operation with given arguments.
func NewOperation ¶ added in v1.3.0
NewOperation creates a default Operation with given arguments.
func NewOptionsOperation ¶ added in v1.3.0
NewOptionsOperation creates an options Operation with given arguments.
func NewPatchOperation ¶ added in v1.3.0
NewPatchOperation creates a patch Operation with given arguments.
func NewPostOperation ¶ added in v1.3.0
NewPostOperation creates a post Operation with given arguments.
func NewPutOperation ¶ added in v1.3.0
NewPutOperation creates a put Operation with given arguments.
func (*Operation) AddConsumes ¶ added in v1.3.0
AddConsumes adds some consumes into Operation.
func (*Operation) AddProduces ¶ added in v1.3.0
AddProduces adds some produces into Operation.
func (*Operation) AddResponses ¶ added in v1.3.0
AddResponses adds some responses into Operation.
func (*Operation) AddSchemes ¶ added in v1.3.0
AddSchemes adds some schemes into Operation.
func (*Operation) AddSecurities ¶ added in v1.3.0
AddSecurities adds some security requirements into Operation.
func (*Operation) AdditionalDoc ¶ added in v1.3.0
AdditionalDoc sets the additional document in Operation, this is only supported in API Blueprint.
func (*Operation) Deprecated ¶ added in v1.3.0
Deprecated sets the deprecated in Operation.
func (*Operation) ExternalDoc ¶ added in v1.3.0
func (o *Operation) ExternalDoc(doc *ExternalDoc) *Operation
ExternalDoc sets the external documentation in Operation.
func (*Operation) GetAdditionalDoc ¶ added in v1.3.0
GetAdditionalDoc returns the additional document from Operation.
func (*Operation) GetConsumes ¶ added in v1.3.0
GetConsumes returns the whole consumes from Operation.
func (*Operation) GetDeprecated ¶ added in v1.3.0
GetDeprecated returns the deprecated from Operation.
func (*Operation) GetExternalDoc ¶ added in v1.3.0
func (o *Operation) GetExternalDoc() *ExternalDoc
GetExternalDoc returns the external documentation from Operation.
func (*Operation) GetOperationId ¶ added in v1.3.0
GetOperationId returns the operationId from Operation.
func (*Operation) GetProduces ¶ added in v1.3.0
GetProduces returns the whole produces from Operation.
func (*Operation) GetRequestExample ¶ added in v1.3.0
func (o *Operation) GetRequestExample() interface{}
GetRequestExample returns the request example from Operation.
func (*Operation) GetResponses ¶ added in v1.3.0
GetResponses returns the whole responses from Operation.
func (*Operation) GetSchemes ¶ added in v1.3.0
GetSchemes returns the whole schemes from Operation.
func (*Operation) GetSecurities ¶ added in v1.3.0
GetSecurities returns the whole securities requirements from Operation.
func (*Operation) GetSecuritiesScopes ¶ added in v1.3.0
GetSecuritiesScopes returns the whole securities scopes from Operation.
func (*Operation) GetSummary ¶ added in v1.3.0
GetSummary returns the summary from Operation.
func (*Operation) OperationId ¶ added in v1.3.0
OperationId sets the operationId in Operation.
func (*Operation) RequestExample ¶ added in v1.3.0
RequestExample sets the request example in Operation, this is only supported in API Blueprint.
func (*Operation) Securities ¶ added in v1.3.0
Securities sets the whole security requirements in Operation.
func (*Operation) SetSecurityScopes ¶ added in v1.3.0
SetSecurityScopes sets a security's scopes in Operation.
type Option ¶ added in v1.3.0
type Option struct {
// contains filtered or unexported fields
}
Option represents an api extra option of Document.
func GetOption ¶ added in v1.3.0
func GetOption() *Option
GetOption returns the option from global Document.
func (*Option) AddConsumes ¶ added in v1.3.0
AddConsumes adds some consumes into Option.
func (*Option) AddGlobalParams ¶ added in v1.3.1
AddGlobalParams adds some global params into Option.
func (*Option) AddProduces ¶ added in v1.3.0
AddProduces adds some produces into Option.
func (*Option) AddRoutesOptions ¶ added in v1.3.0
func (o *Option) AddRoutesOptions(options ...*RoutesOption) *Option
AddRoutesOptions adds some routes group options in Option, this is only supported in API Blueprint.
func (*Option) AddSchemes ¶ added in v1.3.0
AddSchemes adds some schemes into Option.
func (*Option) AddSecurities ¶ added in v1.3.0
AddSecurities adds some securities into Option.
func (*Option) AdditionalDoc ¶ added in v1.3.0
AdditionalDoc sets the additional document in Option, this is only supported in API Blueprint.
func (*Option) ExternalDoc ¶ added in v1.3.0
func (o *Option) ExternalDoc(doc *ExternalDoc) *Option
ExternalDoc sets the external documentation in Option.
func (*Option) GetAdditionalDoc ¶ added in v1.3.0
GetAdditionalDoc returns the additional document from Option.
func (*Option) GetConsumes ¶ added in v1.3.0
GetConsumes returns the whole consumes from Option.
func (*Option) GetExternalDoc ¶ added in v1.3.0
func (o *Option) GetExternalDoc() *ExternalDoc
GetExternalDoc returns the external documentation from Option.
func (*Option) GetGlobalParams ¶ added in v1.3.1
GetGlobalParams returns the whole global params from Option.
func (*Option) GetProduces ¶ added in v1.3.0
GetProduces returns the whole produces from Option.
func (*Option) GetRoutesOptions ¶ added in v1.3.0
func (o *Option) GetRoutesOptions() []*RoutesOption
GetRoutesOptions returns the whole routes options from Option.
func (*Option) GetSchemes ¶ added in v1.3.0
GetSchemes returns the whole schemes from Option.
func (*Option) GetSecurities ¶ added in v1.3.0
GetSecurities returns the whole securities from Option.
func (*Option) GlobalParams ¶ added in v1.3.1
GlobalParams sets the whole global params in Option.
func (*Option) RoutesOptions ¶ added in v1.3.0
func (o *Option) RoutesOptions(options ...*RoutesOption) *Option
RoutesOptions sets the whole routes group options in Option, this is only supported in API Blueprint.
func (*Option) Securities ¶ added in v1.3.0
Securities sets the whole securities in Option.
type Param ¶
type Param struct {
// contains filtered or unexported fields
}
Param represents a request parameter information of Operation.
func NewBodyParam ¶
NewBodyParam creates a body Param with given arguments.
func NewFormParam ¶
NewFormParam creates a form Param with given arguments.
func NewHeaderParam ¶
NewHeaderParam creates a header Param with given arguments.
func NewPathParam ¶
NewPathParam creates a path Param with given arguments.
func NewQueryParam ¶
NewQueryParam creates a query Param with given arguments.
func (*Param) AllowEmpty ¶
AllowEmpty sets the allowEmpty in Param.
func (*Param) CollectionFormat ¶ added in v1.3.0
CollectionFormat sets the collectionFormat in Param.
func (*Param) ExclusiveMax ¶ added in v1.3.0
ExclusiveMax sets the exclusiveMax in Param.
func (*Param) ExclusiveMin ¶ added in v1.3.0
ExclusiveMin sets the exclusiveMin in Param.
func (*Param) GetAllowEmpty ¶ added in v1.3.0
GetAllowEmpty returns the allowEmpty from Param.
func (*Param) GetCollectionFormat ¶ added in v1.3.0
GetCollectionFormat returns the collectionFormat from Param.
func (*Param) GetDefault ¶ added in v1.3.0
func (p *Param) GetDefault() interface{}
GetDefault returns the default from Param.
func (*Param) GetEnum ¶ added in v1.3.0
func (p *Param) GetEnum() []interface{}
GetEnum returns the whole enum from Param.
func (*Param) GetExample ¶ added in v1.3.0
func (p *Param) GetExample() interface{}
GetExample returns the example from Param.
func (*Param) GetExclusiveMax ¶ added in v1.3.0
GetExclusiveMax returns the exclusiveMax from Param.
func (*Param) GetExclusiveMin ¶ added in v1.3.0
GetExclusiveMin returns the exclusiveMin from Param.
func (*Param) GetItemOption ¶ added in v1.3.0
func (p *Param) GetItemOption() *ItemOption
GetItemOption returns the item option from Param.
func (*Param) GetMaxItems ¶ added in v1.3.0
GetMaxItems returns the maxItems from Param.
func (*Param) GetMaxLength ¶ added in v1.3.0
GetMaxLength returns the maxLength from Param.
func (*Param) GetMaximum ¶ added in v1.3.0
GetMaximum returns the maximum from Param.
func (*Param) GetMinItems ¶ added in v1.3.0
GetMinItems returns the minItems from Param.
func (*Param) GetMinLength ¶ added in v1.3.0
GetMinLength returns the minLength from Param.
func (*Param) GetMinimum ¶ added in v1.3.0
GetMinimum returns the minimum from Param.
func (*Param) GetMultipleOf ¶ added in v1.3.0
GetMultipleOf returns the multipleOf from Param.
func (*Param) GetPattern ¶ added in v1.3.0
GetPattern returns the pattern from Param.
func (*Param) GetRequired ¶ added in v1.3.0
GetRequired returns the required from Param.
func (*Param) GetUniqueItems ¶ added in v1.3.0
GetUniqueItems returns the uniqueItems from Param.
func (*Param) GetXMLRepr ¶ added in v1.3.0
GetXMLRepr returns the xml repr from Param.
func (*Param) ItemOption ¶ added in v1.3.0
func (p *Param) ItemOption(itemOption *ItemOption) *Param
ItemOption sets the item option in Param, this is only supported in Swagger.
func (*Param) ItemsRange ¶ added in v1.3.0
ItemsRange sets the minItems and maxItems in Param.
func (*Param) LengthRange ¶ added in v1.3.0
LengthRange sets the minLength and maxLength in Param.
func (*Param) MultipleOf ¶ added in v1.3.0
MultipleOf sets the multipleOf in Param.
func (*Param) UniqueItems ¶ added in v1.3.0
UniqueItems sets the uniqueItems in Param.
func (*Param) ValueRange ¶ added in v1.3.0
ValueRange sets the minimum and maximum in Param.
type Property ¶
type Property struct {
// contains filtered or unexported fields
}
Property represents a definition property information of Definition.
func NewProperty ¶
NewProperty creates a default Property with given arguments.
func (*Property) AllowEmpty ¶
AllowEmpty sets the allowEmpty in Property.
func (*Property) CollectionFormat ¶ added in v1.3.0
CollectionFormat sets the collectionFormat in Property.
func (*Property) ExclusiveMax ¶ added in v1.3.0
ExclusiveMax sets the exclusiveMax in Property.
func (*Property) ExclusiveMin ¶ added in v1.3.0
ExclusiveMin sets the exclusiveMin in Property.
func (*Property) GetAllowEmpty ¶ added in v1.3.0
GetAllowEmpty returns the allowEmpty from Property.
func (*Property) GetCollectionFormat ¶ added in v1.3.0
GetCollectionFormat returns the collectionFormat from Property.
func (*Property) GetDefault ¶ added in v1.3.0
func (p *Property) GetDefault() interface{}
GetDefault returns the default from Property.
func (*Property) GetEnum ¶ added in v1.3.0
func (p *Property) GetEnum() []interface{}
GetEnum returns the enum from Property.
func (*Property) GetExample ¶ added in v1.3.0
func (p *Property) GetExample() interface{}
GetExample returns the example from Property.
func (*Property) GetExclusiveMax ¶ added in v1.3.0
GetExclusiveMax returns the exclusiveMax from Property.
func (*Property) GetExclusiveMin ¶ added in v1.3.0
GetExclusiveMin returns the exclusiveMin from Property.
func (*Property) GetItemOption ¶ added in v1.3.0
func (p *Property) GetItemOption() *ItemOption
GetItemOption returns the item option from Property.
func (*Property) GetMaxItems ¶ added in v1.3.0
GetMaxItems returns the maxItems from Property.
func (*Property) GetMaxLength ¶ added in v1.3.0
GetMaxLength returns the maxLength from Property.
func (*Property) GetMaximum ¶ added in v1.3.0
GetMaximum returns the maximum from Property.
func (*Property) GetMinItems ¶ added in v1.3.0
GetMinItems returns the minItems from Property.
func (*Property) GetMinLength ¶ added in v1.3.0
GetMinLength returns the minLength from Property.
func (*Property) GetMinimum ¶ added in v1.3.0
GetMinimum returns the minimum from Property.
func (*Property) GetMultipleOf ¶ added in v1.3.0
GetMultipleOf returns the multipleOf from Property.
func (*Property) GetPattern ¶ added in v1.3.0
GetPattern returns the pattern from Property.
func (*Property) GetRequired ¶ added in v1.3.0
GetRequired returns the required from Property.
func (*Property) GetUniqueItems ¶ added in v1.3.0
GetUniqueItems returns the uniqueItems from Property.
func (*Property) GetXMLRepr ¶ added in v1.3.0
GetXMLRepr returns the xml repr from Property.
func (*Property) ItemOption ¶ added in v1.3.0
func (p *Property) ItemOption(itemOption *ItemOption) *Property
ItemOption sets the item option in Property, this is only supported in Swagger.
func (*Property) ItemsRange ¶ added in v1.3.0
ItemsRange sets the minItems and maxItems in Property.
func (*Property) LengthRange ¶ added in v1.3.0
LengthRange sets the minLength and maxLength in Property.
func (*Property) MultipleOf ¶ added in v1.3.0
MultipleOf sets the multipleOf in Property.
func (*Property) UniqueItems ¶ added in v1.3.0
UniqueItems sets the uniqueItems in Property.
func (*Property) ValueRange ¶ added in v1.3.0
ValueRange sets the minimum and maximum in Property.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response represents an operation response information of Operation.
func NewResponse ¶
NewResponse creates a default Response with given arguments.
func (*Response) AddExamples ¶ added in v1.3.0
func (r *Response) AddExamples(examples ...*ResponseExample) *Response
AddExamples add some response examples into Response.
func (*Response) AddHeaders ¶ added in v1.3.0
func (r *Response) AddHeaders(headers ...*ResponseHeader) *Response
AddHeaders add some response headers in Response.
func (*Response) AdditionalDoc ¶ added in v1.3.0
AdditionalDoc sets the additional document in Response, this is only supported in API Blueprint.
func (*Response) Examples ¶
func (r *Response) Examples(examples ...*ResponseExample) *Response
Examples sets the whole response examples in Response.
func (*Response) GetAdditionalDoc ¶ added in v1.3.0
GetAdditionalDoc returns the additional document from Response
func (*Response) GetExamples ¶ added in v1.3.0
func (r *Response) GetExamples() []*ResponseExample
GetExamples returns the whole response examples from Response
func (*Response) GetHeaders ¶ added in v1.3.0
func (r *Response) GetHeaders() []*ResponseHeader
GetHeaders returns the whole response headers from Response
func (*Response) Headers ¶
func (r *Response) Headers(headers ...*ResponseHeader) *Response
Headers sets the whole response headers in Response.
type ResponseExample ¶ added in v1.3.0
type ResponseExample struct {
// contains filtered or unexported fields
}
ResponseExample represents a response example information of Response.
func NewResponseExample ¶ added in v1.3.0
func NewResponseExample(mime string, example interface{}) *ResponseExample
NewResponseExample creates a default ResponseExample with given arguments.
func (*ResponseExample) Example ¶ added in v1.3.0
func (r *ResponseExample) Example(example interface{}) *ResponseExample
Example sets the example in ResponseExample.
func (*ResponseExample) GetExample ¶ added in v1.3.0
func (r *ResponseExample) GetExample() interface{}
GetExample returns the example from ResponseExample.
func (*ResponseExample) GetMime ¶ added in v1.3.0
func (r *ResponseExample) GetMime() string
GetMime returns the mime from ResponseExample.
func (*ResponseExample) Mime ¶ added in v1.3.0
func (r *ResponseExample) Mime(mime string) *ResponseExample
Mime sets the mime in ResponseExample.
type ResponseHeader ¶ added in v1.3.0
type ResponseHeader struct {
// contains filtered or unexported fields
}
ResponseHeader represents a response header information of Response.
func NewResponseHeader ¶ added in v1.3.0
func NewResponseHeader(name, typ, desc string) *ResponseHeader
NewResponseHeader creates a default Header with given arguments.
func (*ResponseHeader) Desc ¶ added in v1.3.0
func (h *ResponseHeader) Desc(desc string) *ResponseHeader
Desc sets the desc in ResponseHeader.
func (*ResponseHeader) Example ¶ added in v1.3.0
func (h *ResponseHeader) Example(example interface{}) *ResponseHeader
Example sets the example in ResponseHeader.
func (*ResponseHeader) GetDesc ¶ added in v1.3.0
func (h *ResponseHeader) GetDesc() string
GetDesc returns the desc from ResponseHeader.
func (*ResponseHeader) GetExample ¶ added in v1.3.0
func (h *ResponseHeader) GetExample() interface{}
GetExample returns the example from ResponseHeader.
func (*ResponseHeader) GetName ¶ added in v1.3.0
func (h *ResponseHeader) GetName() string
GetName returns the name from ResponseHeader.
func (*ResponseHeader) GetType ¶ added in v1.3.0
func (h *ResponseHeader) GetType() string
GetType returns the type from ResponseHeader.
func (*ResponseHeader) Name ¶ added in v1.3.0
func (h *ResponseHeader) Name(name string) *ResponseHeader
Name sets the name in ResponseHeader.
func (*ResponseHeader) Type ¶ added in v1.3.0
func (h *ResponseHeader) Type(typ string) *ResponseHeader
Type sets the type in ResponseHeader.
type RoutesOption ¶ added in v1.3.0
type RoutesOption struct {
// contains filtered or unexported fields
}
RoutesOption represents a routes group option of Document, this is only supported in API Blueprint.
func NewRoutesOption ¶ added in v1.3.0
func NewRoutesOption(route string) *RoutesOption
NewRoutesOption creates a default RoutesOption with given arguments.
func (*RoutesOption) AdditionalDoc ¶ added in v1.3.0
func (r *RoutesOption) AdditionalDoc(additionalDoc string) *RoutesOption
AdditionalDoc sets the additional document in RoutesOption, this is only supported in API Blueprint.
func (*RoutesOption) GetAdditionalDoc ¶ added in v1.3.0
func (r *RoutesOption) GetAdditionalDoc() string
GetAdditionalDoc returns the additional document from RoutesOption.
func (*RoutesOption) GetRoute ¶ added in v1.3.0
func (r *RoutesOption) GetRoute() string
GetRoute returns the route from RoutesOption.
func (*RoutesOption) GetSummary ¶ added in v1.3.0
func (r *RoutesOption) GetSummary() string
GetSummary returns the summary from RoutesOption.
func (*RoutesOption) Route ¶ added in v1.3.0
func (r *RoutesOption) Route(route string) *RoutesOption
Route sets the route in RoutesOption.
func (*RoutesOption) Summary ¶ added in v1.3.0
func (r *RoutesOption) Summary(summary string) *RoutesOption
Summary sets the summary in RoutesOption.
type Security ¶
type Security struct {
// contains filtered or unexported fields
}
Security represents a security definition information of Document.
func NewApiKeySecurity ¶ added in v1.3.0
NewApiKeySecurity creates an apiKey authentication Security with given arguments.
func NewBasicSecurity ¶ added in v1.3.0
NewBasicSecurity creates a basic authentication Security with given arguments.
func NewOAuth2Security ¶ added in v1.3.0
NewOAuth2Security creates an oauth2 authentication Security with given arguments.
func NewSecurity ¶
NewSecurity creates a default Security with given arguments.
func (*Security) AddScopes ¶ added in v1.3.0
func (s *Security) AddScopes(scopes ...*SecurityScope) *Security
AddScopes add some security scopes into Security.
func (*Security) AuthorizationUrl ¶ added in v1.3.0
AuthorizationUrl sets the authorization url in Security.
func (*Security) GetAuthorizationUrl ¶ added in v1.3.0
GetAuthorizationUrl returns the authorization url from Security.
func (*Security) GetScopes ¶ added in v1.3.0
func (s *Security) GetScopes() []*SecurityScope
GetScopes returns the whole security scopes from Security.
func (*Security) GetTokenUrl ¶ added in v1.3.0
GetTokenUrl returns the token url from Security.
func (*Security) Scopes ¶ added in v1.3.0
func (s *Security) Scopes(scopes ...*SecurityScope) *Security
Scopes sets the whole security scopes in Security.
type SecurityScope ¶ added in v1.3.0
type SecurityScope struct {
// contains filtered or unexported fields
}
SecurityScope represents a security scope information of Document.
func NewSecurityScope ¶ added in v1.3.0
func NewSecurityScope(scope, desc string) *SecurityScope
NewSecurityScope creates a default SecurityScope with given arguments.
func (*SecurityScope) Desc ¶ added in v1.3.0
func (s *SecurityScope) Desc(desc string) *SecurityScope
Desc sets the desc in Security.
func (*SecurityScope) GetDesc ¶ added in v1.3.0
func (s *SecurityScope) GetDesc() string
GetDesc returns the desc from SecurityScope.
func (*SecurityScope) GetScope ¶ added in v1.3.0
func (s *SecurityScope) GetScope() string
GetScope returns the scope from SecurityScope.
func (*SecurityScope) Scope ¶ added in v1.3.0
func (s *SecurityScope) Scope(scope string) *SecurityScope
Scope sets the scope in Security.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag represents a tag information of Document.
func (*Tag) AdditionalDoc ¶ added in v1.3.0
AdditionalDoc sets the additional document in Tag, this is only supported in API Blueprint.
func (*Tag) ExternalDoc ¶ added in v1.3.0
func (t *Tag) ExternalDoc(doc *ExternalDoc) *Tag
ExternalDoc sets the external documentation in Tag.
func (*Tag) GetAdditionalDoc ¶ added in v1.3.0
GetAdditionalDoc returns the additional document from Tag.
func (*Tag) GetExternalDoc ¶ added in v1.3.0
func (t *Tag) GetExternalDoc() *ExternalDoc
GetExternalDoc returns the external documentation from Tag.
type XMLRepr ¶ added in v1.3.0
type XMLRepr struct {
// contains filtered or unexported fields
}
XMLRepr represents a xml representation format information of Definition, Property, Param an ItemOption, this is only supported in Swagger.
func NewXMLRepr ¶ added in v1.3.0
NewXMLRepr creates a default XMLRepr with given arguments.
func (*XMLRepr) GetAttribute ¶ added in v1.3.0
GetAttribute returns the attribute from XMLRepr.
func (*XMLRepr) GetNamespace ¶ added in v1.3.0
GetNamespace returns the namespace from XMLRepr.
func (*XMLRepr) GetWrapped ¶ added in v1.3.0
GetWrapped returns the wrapped from XMLRepr.