Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyHeader ¶
Types ¶
type Action ¶
type Action struct {
Title string
Description string
Method HTTPMethod
Requests []*Request
}
func (*Action) AddRequest ¶
type Body ¶
func (*Body) FormattedJSON ¶
func (*Body) FormattedMultipartFormData ¶
func (*Body) FormattedStr ¶
type Doc ¶
type Doc struct {
Group ResourceGroup
// contains filtered or unexported fields
}
func (*Doc) AddResource ¶
TODO: add Resource to appropriate ResourceGroup,
not just to ResourceGroups[0]
type HTTPMethod ¶
type HTTPMethod string
type Parameter ¶
type Parameter struct {
Name string
Description string
Value ParameterValue
Type ParameterType
IsRequired bool
DefaultValue string
}
func MakeParameter ¶
type ParameterType ¶
type ParameterType int
const ( Number ParameterType = iota String Boolean )
func (ParameterType) String ¶
func (pt ParameterType) String() string
type ParameterValue ¶
type ParameterValue string
func (ParameterValue) Quote ¶
func (val ParameterValue) Quote() (qval string)
type Request ¶
type Request struct {
Header *Header
Body *Body
Method string
Response *Response
Attributes []Attribute
}
func (*Request) HasContentType ¶
type Resource ¶
type Resource struct {
Title string
Description string
//Model *Model
URL *URL
Actions map[HTTPMethod]*Action
}
func (*Resource) FindAction ¶
type ResourceGroup ¶
func (*ResourceGroup) Render ¶
func (rg *ResourceGroup) Render() string
type Response ¶
func NewResponse ¶
func NewResponse(resp *httptest.ResponseRecorder) *Response
func (*Response) HasContentType ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.