Versions in this module Expand all Collapse all v1 v1.0.0 Aug 3, 2020 Changes in this version + func CopyHeader(dst, src http.Header) + type Action struct + Description string + Method HTTPMethod + Requests []*Request + Title string + func NewAction(method, handlerName string) (*Action, error) + func (a *Action) AddRequest(req *Request, resp *Response) + func (a *Action) Render() string + type Body struct + Content []byte + ContentType string + func NewBody(content []byte, contentType string) (b *Body) + func (b *Body) FormattedJSON() string + func (b *Body) FormattedStr() string + func (b *Body) Render() string + type Doc struct + Group ResourceGroup + func NewDoc(pkgDir string) (doc *Doc, err error) + func (d *Doc) AddResource(resource *Resource) + func (d *Doc) Write() error + type HTTPMethod string + type Header struct + ContentType string + DisplayHeader http.Header + func NewHeader(h http.Header) *Header + func (h Header) Render() string + type Metadata struct + Format string + Host string + type Parameter struct + Description string + IsRequired bool + Name string + Type ParameterType + Value ParameterValue + func MakeParameter(key, val string) Parameter + func (p *Parameter) Render() string + type ParameterType int + const Boolean + const Number + const String + func (pt ParameterType) String() string + type ParameterValue string + func (val ParameterValue) Quote() (qval string) + type Request struct + Body *Body + Header *Header + Method string + Response *Response + func NewRequest(req *http.Request) (*Request, error) + func (r *Request) HasBody() bool + func (r *Request) HasContentType() bool + func (r *Request) HasHeader() bool + func (r *Request) Render() string + type Resource struct + Actions map[HTTPMethod]*Action + CreatedAt time.Time + Description string + Title string + URL *URL + func NewResource(u *URL) *Resource + func (r *Resource) AddAction(action *Action) + func (r *Resource) FindAction(httpMethod string) *Action + func (r *Resource) Render() string + type ResourceGroup struct + Description string + Resources []Resource + Title string + func (rg *ResourceGroup) Render() string + type Response struct + Body *Body + Description string + Header *Header + StatusCode int + func NewResponse(resp *httptest.ResponseRecorder) *Response + func (r *Response) HasContentType() bool + func (r *Response) Render() string + type URL struct + ParameterizedPath string + Parameters []Parameter + func NewURL(req *http.Request) *URL