Documentation ¶
Index ¶
Constants ¶
View Source
const ( TitleHeader = "X-Test2Doc-Title" DescriptionHeader = "X-Test2Doc-Description" FilterHeader = "X-Test2Doc-Filter" )
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 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 }
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 Title string Description string }
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.