Documentation ¶
Index ¶
- Constants
- func CleanCustomTypeName(name string) string
- type Api
- type Body
- type CustomType
- type CustomTypeProperty
- type Header
- type Href
- type MediaType
- type Option
- type Parameter
- type Protocol
- type Request
- type Resource
- type ResourceAction
- type ResourceGroup
- type Response
- type SecurityScheme
- type SecuritySchemeSetting
- type Trait
- type Transaction
Constants ¶
const ( HTTP_PROTOCOL = "http" HTTPS_PROTOCOL = "https" )
Variables ¶
This section is empty.
Functions ¶
func CleanCustomTypeName ¶
CleanCustomTypeName It responsible for removing expressions
Types ¶
type Api ¶
type Api struct { Title string Version string BaseURI string BaseURIParameters []Parameter Protocols []Protocol MediaTypes []MediaType CustomTypes []CustomType Traits []Trait SecuritySchemes []SecurityScheme SecuredBy []Option ResourceGroups []ResourceGroup }
Api Definition structure
func (Api) CustomTypeByName ¶
func (def Api) CustomTypeByName(name string) (ct CustomType)
CustomTypeByName Returns a CustomType struct based on its name
type Body ¶
type Body struct { Description string Type string CustomType *CustomType MediaType MediaType Example string }
Body
type CustomType ¶
type CustomType struct { Name string Description string Type interface{} Default interface{} Enum interface{} Properties []CustomTypeProperty Examples []interface{} }
CustomType represents custom types
type CustomTypeProperty ¶
type CustomTypeProperty struct { Name string Type string Required bool Description string Example string Properties []CustomTypeProperty }
CustomTypeProperty Represents a property of a custom type
type MediaType ¶
type MediaType string
MediaType represents the media types available on the API. e.g application/json
type Parameter ¶
type Parameter struct { Name string Description string Type string Required bool Pattern *string MinLength *int MaxLength *int Min *float64 Max *float64 Example interface{} }
Parameter
type Protocol ¶
type Protocol string
Protocol
func NewProtocolFromURL ¶
NewProtocolFromURL Returns the protocol based on the URL
type Resource ¶
type Resource struct { Title string Description string Href Href Is []Option SecuredBy []Option Actions []ResourceAction Resources []Resource }
Resource represents a resource. e.g. /examples
type ResourceAction ¶
type ResourceAction struct { Title string Description string Method string Href Href Is []Option SecuredBy []Option Transactions []Transaction }
ResourceAction represents an action for a resource. e.g. GET /examples or POST /examples
type ResourceGroup ¶
ResourceGroup groups logically bound resources
type SecurityScheme ¶
type SecurityScheme struct { Name string Description string Type string Transactions []Transaction Settings []SecuritySchemeSetting }
SecurityScheme
type SecuritySchemeSetting ¶
type SecuritySchemeSetting struct { Name string Data interface{} }
Setting
type Trait ¶
type Trait struct { Name string Usage string Description string Protocols []Protocol Href Href Transactions []Transaction }
Trait Optional definition that
type Transaction ¶
Transaction groups a pair request/response