Documentation ¶
Index ¶
- Variables
- type ArticleAuthInfo
- type ArticleElement
- type ArticleFieldList
- type ArticleSection
- type ArticleText
- type CURLDataKeyValue
- type CURLDataText
- type CURLDataType
- type CodeSnippet
- type CodeSnippetCURL
- type CodeSnippetElement
- type CodeSnippetHTTP
- type Content
- type EndpointItem
- type EnumItem
- type EnumList
- type ExampleElement
- type ExampleEndpoints
- type ExampleObject
- type ExampleRequest
- type ExampleResponse
- type ExampleSection
- type ExampleText
- type FieldItem
- type FieldList
- type FieldListClass
- type Footer
- type Header
- type HeaderItem
- type Page
- type SelectOption
- type Sidebar
- type SidebarBanner
- type SidebarBannerHTML
- type SidebarBannerTitle
- type SidebarFooter
- type SidebarHeader
- type SidebarItem
- type SidebarList
- type SourceLink
Constants ¶
This section is empty.
Variables ¶
View Source
var T = template.Must(template.New("t").Funcs(helpers).Parse(strings.Join([]string{
page_root,
sidebar,
sidebar_header,
sidebar_footer,
sidebar_lists,
sidebar_item,
content,
content_header,
content_footer,
content_articles,
article,
article_primary_column,
article_example_column,
article_section_list,
article_lead,
article_text,
article_auth_info,
article_field_list,
field_list,
field_item,
field_children,
enum_list,
example_section_list,
example_endpoints,
example_text,
example_object,
example_response,
example_request,
example_request_topbar,
example_request_body,
code_snippet_http,
code_snippet_curl,
code_block_pre,
svg_code_icon,
svg_code_icon_use,
curl_data,
}, "")))
Functions ¶
This section is empty.
Types ¶
type ArticleAuthInfo ¶
type ArticleElement ¶
type ArticleElement struct { // The id attribute of the article. Id string // The URL path to the article. Path string // The article's anchor. Href string // The article's title. Title string // A link to the source code associated with the article. SourceLink *SourceLink // The article's HTML text. Text template.HTML // A list of additional sections of the article. Sections []ArticleSection // An example related to the article. Example ExampleElement // A list of sub articles. SubArticles []*ArticleElement // If set, indicates that this article has no parent article. IsRoot bool }
type ArticleFieldList ¶
type ArticleSection ¶
type ArticleSection interface {
// contains filtered or unexported methods
}
type ArticleText ¶
type CURLDataKeyValue ¶
type CURLDataText ¶
type CURLDataText string
func (CURLDataText) HTML ¶
func (s CURLDataText) HTML() template.HTML
type CURLDataType ¶
type CURLDataType interface {
// contains filtered or unexported methods
}
////////////////////////////////////////////////////////////////////////////// cURL specific types //////////////////////////////////////////////////////////////////////////////
type CodeSnippet ¶
type CodeSnippet interface {
// contains filtered or unexported methods
}
type CodeSnippetCURL ¶
type CodeSnippetCURL struct { // The target URL URL string // The -X/--request option X string // The -H/--header options H []string // the -d/--data options Data []CURLDataType }
func (*CodeSnippetCURL) ClassMethod ¶
func (cs *CodeSnippetCURL) ClassMethod() string
func (*CodeSnippetCURL) NumOpts ¶
func (cs *CodeSnippetCURL) NumOpts() int
type CodeSnippetElement ¶
type CodeSnippetElement struct { Id string // the id of the snippet's primary element Show bool // indicates whether or not to show this snippet Lang string // the language of the snippet's code NumLines int // the number of lines needed to render the snippet Snippet CodeSnippet }
func (*CodeSnippetElement) Lines ¶
func (e *CodeSnippetElement) Lines() []struct{}
type CodeSnippetHTTP ¶
type CodeSnippetHTTP struct {
// The start line
Method, RequestURI, HTTPVersion string
// The header fields
Headers []HeaderItem
// The message body
Body template.HTML
}
CodeSnippetHTTP represents a raw HTTP request message.
func (*CodeSnippetHTTP) ClassMethod ¶
func (cs *CodeSnippetHTTP) ClassMethod() string
type Content ¶
type Content struct { Header Header Articles []*ArticleElement }
type EndpointItem ¶
type EnumItem ¶
type EnumItem struct { // The enum's value. Value string // The enum's documentation text. Text template.HTML // A link to the source of the enum's declaration. SourceLink *SourceLink }
type ExampleElement ¶
type ExampleElement struct {
Sections []ExampleSection
}
type ExampleEndpoints ¶
type ExampleEndpoints struct { Title string Endpoints []*EndpointItem }
type ExampleRequest ¶
type ExampleRequest struct { Title string Method string Pattern string Options []*SelectOption Snippets []*CodeSnippetElement }
type ExampleResponse ¶
type ExampleSection ¶
type ExampleSection interface {
// contains filtered or unexported methods
}
type ExampleText ¶
type FieldItem ¶
type FieldItem struct { // The unique identifier of the item. Id string // The href linking to the item. Href string // The name of the field. Name string // The path to the field's name if nested, otherwise empty. Path string // The name of the field's type. Type string // The field's documentation. Text template.HTML // A link to the source of the field. SourceLink *SourceLink // SettingLabel and SettingText are used to indicates whether the field // is required, optional, or something else. The SettingLabel is used as // part of the associated CSS class name. The SettingText is used as the // text to be rendered in the documentation. SettingLabel, SettingText string // The field's validation documentation. Validation template.HTML // A list of enum values associated with the field's type. EnumList *EnumList // If the field's type is a struct then SubFields will hold the fields // of that struct. If the field's type is not a struct then SubFields // will be nil. SubFields []*FieldItem }
type FieldList ¶
type FieldList struct { Title string Class FieldListClass Items []*FieldItem }
type FieldListClass ¶
type FieldListClass uint
const ( FIELD_LIST_HEADER FieldListClass FIELD_LIST_PATH FIELD_LIST_QUERY FIELD_LIST_BODY FIELD_LIST_OBJECT )
func (FieldListClass) String ¶
func (c FieldListClass) String() string
type HeaderItem ¶
type Page ¶
type Page struct { Title string Sidebar Sidebar // NOTE(mkopriva): The code that's writing the Page into files relies on // the Content field to be a non-pointer. If it later needs to be changed // to a pointer, then the page-writing code needs to be updated to create // a shallow copy of the pointed-to Content. Content Content // The id of the element which should act as the anchor for the initial page load. AnchorId string AddCustomCSS bool RandomHash string }
type SelectOption ¶
type Sidebar ¶
type Sidebar struct { Header SidebarHeader Lists []*SidebarList }
type SidebarBanner ¶
type SidebarBanner interface {
// contains filtered or unexported methods
}
type SidebarBannerHTML ¶
type SidebarBannerTitle ¶
type SidebarFooter ¶
type SidebarFooter struct { }
type SidebarHeader ¶
type SidebarHeader struct {
Banner SidebarBanner
}
type SidebarItem ¶
type SidebarItem struct { Text string Href string Anchor string SubItems []*SidebarItem }
func (*SidebarItem) ListItemClass ¶
func (si *SidebarItem) ListItemClass() string
type SidebarList ¶
type SidebarList struct { Title string Items []*SidebarItem }
type SourceLink ¶
Click to show internal directories.
Click to hide internal directories.