Documentation
¶
Index ¶
- Constants
- func NewWebController(documentation Documentation) *webController
- type BlockInterface
- type Documentation
- func (doc *Documentation) AddBlock(block BlockInterface) *Documentation
- func (doc *Documentation) GetBlocks() []BlockInterface
- func (doc *Documentation) GetDescription() string
- func (doc *Documentation) GetHandlerURL() string
- func (doc *Documentation) GetHomeURL() string
- func (doc *Documentation) GetLogo() string
- func (doc *Documentation) GetTheme() string
- func (doc *Documentation) GetThemesDark() []struct{ ... }
- func (doc *Documentation) GetThemesLight() []struct{ ... }
- func (doc *Documentation) GetTitle() string
- func (doc *Documentation) IsThemeDark(theme string) bool
- func (doc *Documentation) IsThemeLight(theme string) bool
- func (doc *Documentation) SetBlocks(blocks []BlockInterface) *Documentation
- func (doc *Documentation) SetDescription(description string) *Documentation
- func (doc *Documentation) SetHandlerURL(handlerURL string) *Documentation
- func (doc *Documentation) SetHomeURL(homeURL string) *Documentation
- func (doc *Documentation) SetLogo(logo string) *Documentation
- func (doc *Documentation) SetTheme(theme string) *Documentation
- func (doc *Documentation) SetThemesDark(themesDark []struct{ ... }) *Documentation
- func (doc *Documentation) SetThemesLight(themesLight []struct{ ... }) *Documentation
- func (doc *Documentation) SetTitle(title string) *Documentation
- type Endpoint
- func (block *Endpoint) AddParameter(Parameter Parameter) *Endpoint
- func (block *Endpoint) AddResponse(response Response) *Endpoint
- func (block *Endpoint) GetContent() string
- func (block *Endpoint) GetDescription() string
- func (block *Endpoint) GetMethod() string
- func (block *Endpoint) GetParameters() []Parameter
- func (block *Endpoint) GetPath() string
- func (block *Endpoint) GetResponses() []Response
- func (block *Endpoint) GetTitle() string
- func (block *Endpoint) GetType() string
- func (block *Endpoint) SetContent(content string) *Endpoint
- func (block *Endpoint) SetDescription(description string) *Endpoint
- func (block *Endpoint) SetMethod(method string) *Endpoint
- func (block *Endpoint) SetParameters(Parameters []Parameter) *Endpoint
- func (block *Endpoint) SetPath(path string) *Endpoint
- func (block *Endpoint) SetResponses(responses []Response) *Endpoint
- func (block *Endpoint) SetTitle(title string) *Endpoint
- func (block *Endpoint) SetType(blockType string) *baseBlock
- type Example
- func (block *Example) GetContent() string
- func (block *Example) GetDescription() string
- func (block *Example) GetSourceCode() string
- func (block *Example) GetSourceLanguage() string
- func (block *Example) GetTitle() string
- func (block *Example) GetType() string
- func (block *Example) SetContent(content string) *Example
- func (block *Example) SetDescription(description string) *Example
- func (block *Example) SetSourceCode(sourceCode string) *Example
- func (block *Example) SetSourceLanguage(sourceLanguage string) *Example
- func (block *Example) SetTitle(title string) *Example
- func (block *Example) SetType(blockType string) *baseBlock
- type Group
- func (block *Group) AddBlock(child BlockInterface) *Group
- func (block *Group) GetBlocks() []BlockInterface
- func (block *Group) GetContent() string
- func (block *Group) GetDescription() string
- func (block *Group) GetTitle() string
- func (block *Group) GetType() string
- func (block *Group) SetBlocks(blocks []BlockInterface) *Group
- func (block *Group) SetContent(content string) *Group
- func (block *Group) SetDescription(content string) *Group
- func (block *Group) SetTitle(title string) *Group
- func (block *Group) SetType(blockType string) *baseBlock
- type Parameter
- func (block *Parameter) GetContent() string
- func (block *Parameter) GetDescription() string
- func (block *Parameter) GetLocation() string
- func (block *Parameter) GetName() string
- func (block *Parameter) GetRequired() bool
- func (block *Parameter) GetTitle() string
- func (block *Parameter) GetType() string
- func (block *Parameter) SetContent(content string) *Parameter
- func (block *Parameter) SetDescription(content string) *Parameter
- func (block *Parameter) SetLocation(location string) *Parameter
- func (block *Parameter) SetName(name string) *Parameter
- func (block *Parameter) SetRequired(required bool) *Parameter
- func (block *Parameter) SetTitle(title string) *Parameter
- func (block *Parameter) SetType(dataType string) *Parameter
- type Response
- func (block *Response) GetContent() string
- func (block *Response) GetContentType() string
- func (block *Response) GetDescription() string
- func (block *Response) GetExample() Example
- func (block *Response) GetStatusCode() string
- func (block *Response) GetTitle() string
- func (block *Response) GetType() string
- func (block *Response) SetContent(content string) *Response
- func (block *Response) SetContentType(contentType string) *Response
- func (block *Response) SetDescription(description string) *Response
- func (block *Response) SetExample(example Example) *Response
- func (block *Response) SetStatusCode(statusCode string) *Response
- func (block *Response) SetTitle(title string) *Response
- func (block *Response) SetType(blockType string) *baseBlock
- type Section
- func (block *Section) GetContent() string
- func (block *Section) GetDescription() string
- func (block *Section) GetTitle() string
- func (block *Section) GetType() string
- func (block *Section) SetContent(content string) *Section
- func (block *Section) SetDescription(description string) *Section
- func (block *Section) SetTitle(title string) *Section
- func (block *Section) SetType(blockType string) *baseBlock
Constants ¶
const BLOCK_TYPE_ENDPOINT = "endpoint"
const BLOCK_TYPE_EXAMPLE = "example"
const BLOCK_TYPE_GROUP = "group"
Block Types
const BLOCK_TYPE_PARAMETER = "parameter"
const BLOCK_TYPE_RESPONSE = "response"
const BLOCK_TYPE_SECTION = "section"
const CONTENT_TYPE_FORM = "application/x-www-form-urlencoded"
const CONTENT_TYPE_JSON = "application/json"
Content types
const CONTENT_TYPE_MULTIPART = "multipart/form-data"
const CONTENT_TYPE_TEXT = "text/plain"
const PARAMETER_LOCATION_BODY = "body"
PARAMETER_LOCATION_BODY represents a parameter located in the HTTP request body as a JSON payload or other structured data (e.g. {"name": "John"}).
const PARAMETER_LOCATION_COOKIE = "cookie"
PARAMETER_LOCATION_COOKIE represents a parameter located in the HTTP request cookie (e.g. token).
const PARAMETER_LOCATION_FORM = "form"
PARAMETER_LOCATION_FORM represents a parameter located in the HTTP request body as form data (e.g. name=John).
const PARAMETER_LOCATION_HEADER = "header"
PARAMETER_LOCATION_HEADER represents a parameter located in the HTTP request header (e.g. Authorization).
const PARAMETER_LOCATION_PATH = "path"
PARAMETER_LOCATION_PATH represents a parameter located in the URL path (e.g. /users/:id).
const PARAMETER_LOCATION_QUERY = "query"
PARAMETER_LOCATION_QUERY represents a parameter located in the URL query string (e.g. ?id=1).
const THEME_CERULEAN = "cerulean"
const THEME_COSMO = "cosmo"
const THEME_CYBORG = "cyborg"
Dark themes
const THEME_DARKLY = "darkly"
const THEME_DEFAULT = "bootstrap"
Light themes
const THEME_FLATLY = "flatly"
const THEME_JOURNAL = "journal"
const THEME_LITERA = "litera"
const THEME_LUMEN = "lumen"
const THEME_LUX = "lux"
const THEME_MATERIA = "materia"
const THEME_MINTY = "minty"
const THEME_MORPH = "morph"
const THEME_PULSE = "pulse"
const THEME_QUARTZ = "quartz"
const THEME_SANDSTONE = "sandstone"
const THEME_SIMPLEX = "simplex"
const THEME_SKETCHY = "sketchy"
const THEME_SLATE = "slate"
const THEME_SOLAR = "solar"
const THEME_SPACELAB = "spacelab"
const THEME_SUPERHERO = "superhero"
const THEME_UNITED = "united"
const THEME_VAPOR = "vapor"
const THEME_YETI = "yeti"
const THEME_ZEPHYR = "zephyr"
Variables ¶
This section is empty.
Functions ¶
func NewWebController ¶
func NewWebController(documentation Documentation) *webController
NewwebController creates a new web controller
Types ¶
type BlockInterface ¶
type Documentation ¶
type Documentation struct {
// contains filtered or unexported fields
}
func NewDocumentation ¶
func NewDocumentation() *Documentation
func (*Documentation) AddBlock ¶
func (doc *Documentation) AddBlock(block BlockInterface) *Documentation
func (*Documentation) GetBlocks ¶
func (doc *Documentation) GetBlocks() []BlockInterface
func (*Documentation) GetDescription ¶
func (doc *Documentation) GetDescription() string
func (*Documentation) GetHandlerURL ¶
func (doc *Documentation) GetHandlerURL() string
GetHandlerURL returns the URL to the handler serving the documentation
func (*Documentation) GetHomeURL ¶
func (doc *Documentation) GetHomeURL() string
func (*Documentation) GetLogo ¶
func (doc *Documentation) GetLogo() string
func (*Documentation) GetTheme ¶
func (doc *Documentation) GetTheme() string
func (*Documentation) GetThemesDark ¶
func (doc *Documentation) GetThemesDark() []struct { Key string Name string }
func (*Documentation) GetThemesLight ¶
func (doc *Documentation) GetThemesLight() []struct { Key string Name string }
func (*Documentation) GetTitle ¶
func (doc *Documentation) GetTitle() string
func (*Documentation) IsThemeDark ¶
func (doc *Documentation) IsThemeDark(theme string) bool
func (*Documentation) IsThemeLight ¶
func (doc *Documentation) IsThemeLight(theme string) bool
func (*Documentation) SetBlocks ¶
func (doc *Documentation) SetBlocks(blocks []BlockInterface) *Documentation
func (*Documentation) SetDescription ¶
func (doc *Documentation) SetDescription(description string) *Documentation
func (*Documentation) SetHandlerURL ¶
func (doc *Documentation) SetHandlerURL(handlerURL string) *Documentation
SetHandlerURL sets the URL to the handler serving the documentation
func (*Documentation) SetHomeURL ¶
func (doc *Documentation) SetHomeURL(homeURL string) *Documentation
func (*Documentation) SetLogo ¶
func (doc *Documentation) SetLogo(logo string) *Documentation
func (*Documentation) SetTheme ¶
func (doc *Documentation) SetTheme(theme string) *Documentation
func (*Documentation) SetThemesDark ¶
func (doc *Documentation) SetThemesDark(themesDark []struct { Key string Name string }) *Documentation
func (*Documentation) SetThemesLight ¶
func (doc *Documentation) SetThemesLight(themesLight []struct { Key string Name string }) *Documentation
func (*Documentation) SetTitle ¶
func (doc *Documentation) SetTitle(title string) *Documentation
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint represents an endpoint block it is used to describe an API endpoint to the documentation
func NewEndpoint ¶
func NewEndpoint() *Endpoint
func (*Endpoint) AddParameter ¶
func (*Endpoint) AddResponse ¶
func (*Endpoint) GetContent ¶
func (*Endpoint) GetDescription ¶
GetDescription is an alias for GetContent
func (*Endpoint) GetParameters ¶
func (*Endpoint) GetResponses ¶
func (*Endpoint) SetContent ¶
func (*Endpoint) SetDescription ¶
SetDescription is an alias for SetContent
func (*Endpoint) SetParameters ¶
func (*Endpoint) SetResponses ¶
type Example ¶
type Example struct {
// contains filtered or unexported fields
}
Example represents an example block with a source code example it is used to add an example section to an endpoint
func NewExample ¶
func NewExample() *Example
func (*Example) GetContent ¶
func (*Example) GetDescription ¶
GetDescription is an alias for GetContent
func (*Example) GetSourceCode ¶
func (*Example) GetSourceLanguage ¶
func (*Example) SetContent ¶
func (*Example) SetDescription ¶
SetDescription is an alias for SetContent
func (*Example) SetSourceCode ¶
func (*Example) SetSourceLanguage ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a block with a title and content it is used to group blocks of similar functionality
func (*Group) AddBlock ¶
func (block *Group) AddBlock(child BlockInterface) *Group
func (*Group) GetBlocks ¶
func (block *Group) GetBlocks() []BlockInterface
func (*Group) GetContent ¶
func (*Group) GetDescription ¶
GetDescription is an alias for GetContent
func (*Group) SetBlocks ¶
func (block *Group) SetBlocks(blocks []BlockInterface) *Group
func (*Group) SetContent ¶
func (*Group) SetDescription ¶
SetDescription is an alias for SetContent
type Parameter ¶
type Parameter struct {
// contains filtered or unexported fields
}
func NewParameter ¶
func NewParameter() *Parameter
func (*Parameter) GetContent ¶
func (*Parameter) GetDescription ¶
GetDescription is an alias for GetContent
func (*Parameter) GetLocation ¶
func (*Parameter) GetRequired ¶
func (*Parameter) SetContent ¶
func (*Parameter) SetDescription ¶
SetDescription is an alias for SetContent
func (*Parameter) SetLocation ¶
func (*Parameter) SetRequired ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response represents a block with a title and content it is used to add a response section to an endpoint
func NewResponse ¶
func NewResponse() *Response
func (*Response) GetContent ¶
func (*Response) GetContentType ¶
func (*Response) GetDescription ¶
GetDescription is an alias for GetContent
func (*Response) GetExample ¶
func (*Response) GetStatusCode ¶
func (*Response) SetContent ¶
func (*Response) SetContentType ¶
func (*Response) SetDescription ¶
SetDescription is an alias for SetContent
func (*Response) SetExample ¶
func (*Response) SetStatusCode ¶
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section represents a section block with a title and content it is used to add an information section to the documentation
func NewSection ¶
func NewSection() *Section
func (*Section) GetContent ¶
func (*Section) GetDescription ¶
GetDescription is an alias for GetContent
func (*Section) SetContent ¶
func (*Section) SetDescription ¶
SetDescription is an alias for SetContent