Documentation ¶
Index ¶
- func IsArrayOfTypes(b bytes.Bytes) bool
- func IsHTTPResponseCode(s string) bool
- func IsStartWithDirective(b bytes.Bytes) bool
- type Coords
- type Directive
- func (d *Directive) AppendChild(child *Directive)
- func (d *Directive) AppendParameter(b bytes.Bytes) error
- func (d *Directive) AppendUnnamedParameter(v string)
- func (d Directive) BodyError(msg string) *jerr.JApiError
- func (d Directive) BodyErrorIndex(msg string, i uint) *jerr.JApiError
- func (d Directive) CopyWoParentAndChildren() Directive
- func (d Directive) Equal(d2 Directive) bool
- func (d Directive) HTTPMethod() (Enumeration, error)
- func (d Directive) HasNamedParameter() bool
- func (d Directive) HasUnnamedParameter() bool
- func (d Directive) JsonRpcMethodName() (string, error)
- func (d Directive) KeywordError(msg string) *jerr.JApiError
- func (d Directive) NamedParameter(k string) string
- func (d Directive) ParameterError(msg string) *jerr.JApiError
- func (d Directive) Path() (string, error)
- func (d *Directive) SetNamedParameter(k, v string) error
- func (d Directive) String() string
- func (d Directive) Type() Enumeration
- func (d Directive) UnnamedParameter() []string
- func (d Directive) UnnamedParametersLen() int
- type Directives
- func (m *Directives) Each(fn eachDirectivesFunc) error
- func (m *Directives) EachReverse(fn eachDirectivesFunc) error
- func (m *Directives) EachSafe(fn eachSafeDirectivesFunc)
- func (m *Directives) Find(fn findDirectivesFunc) (DirectivesItem, bool)
- func (m *Directives) Get(k string) (*Directive, bool)
- func (m *Directives) GetValue(k string) *Directive
- func (m *Directives) Has(k string) bool
- func (m *Directives) Len() int
- func (m *Directives) Map(fn mapDirectivesFunc) error
- func (m *Directives) MarshalJSON() ([]byte, error)
- func (m *Directives) Set(k string, v *Directive)
- func (m *Directives) SetToTop(k string, v *Directive)
- func (m *Directives) Update(k string, fn func(v *Directive) *Directive)
- type DirectivesItem
- type Enumeration
- type IncludeTracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsArrayOfTypes ¶
func IsHTTPResponseCode ¶
func IsStartWithDirective ¶
Types ¶
type Directive ¶
type Directive struct { Annotation string Keyword string // only for Responses (have multiple keywords), for others should match type. BodyCoords Coords Parent *Directive Children []*Directive // HasExplicitContext true if directive's context is opened explicitly with parentheses. HasExplicitContext bool // contains filtered or unexported fields }
Directive represents all info about some Directive
func New ¶
func New(e Enumeration, keywordCoords Coords) *Directive
func NewWithCallStack ¶
func NewWithCallStack(e Enumeration, keywordCoords Coords, includeTracer IncludeTracer) *Directive
func (*Directive) AppendChild ¶
func (*Directive) AppendUnnamedParameter ¶
func (Directive) BodyErrorIndex ¶
func (Directive) CopyWoParentAndChildren ¶
func (Directive) HTTPMethod ¶
func (d Directive) HTTPMethod() (Enumeration, error)
func (Directive) HasNamedParameter ¶
func (Directive) HasUnnamedParameter ¶
func (Directive) JsonRpcMethodName ¶
func (Directive) NamedParameter ¶
func (*Directive) SetNamedParameter ¶
func (Directive) Type ¶
func (d Directive) Type() Enumeration
func (Directive) UnnamedParameter ¶
func (Directive) UnnamedParametersLen ¶
type Directives ¶
type Directives struct {
// contains filtered or unexported fields
}
Directives represent available directives. gen:OrderedMap
func (*Directives) Each ¶
func (m *Directives) Each(fn eachDirectivesFunc) error
Each iterates and perform given function on each item in the map.
func (*Directives) EachReverse ¶
func (m *Directives) EachReverse(fn eachDirectivesFunc) error
EachReverse act almost the same as Each but in reverse order.
func (*Directives) EachSafe ¶
func (m *Directives) EachSafe(fn eachSafeDirectivesFunc)
func (*Directives) Find ¶
func (m *Directives) Find(fn findDirectivesFunc) (DirectivesItem, bool)
Find finds first matched item from the map.
func (*Directives) Get ¶
func (m *Directives) Get(k string) (*Directive, bool)
Get gets a value by key.
func (*Directives) GetValue ¶
func (m *Directives) GetValue(k string) *Directive
GetValue gets a value by key.
func (*Directives) Has ¶
func (m *Directives) Has(k string) bool
Has checks that specified key is set.
func (*Directives) Map ¶
func (m *Directives) Map(fn mapDirectivesFunc) error
Map iterates and changes values in the map.
func (*Directives) MarshalJSON ¶
func (m *Directives) MarshalJSON() ([]byte, error)
func (*Directives) Set ¶
func (m *Directives) Set(k string, v *Directive)
Set sets a value with specified key.
func (*Directives) SetToTop ¶
func (m *Directives) SetToTop(k string, v *Directive)
SetToTop do the same as Set, but new key will be placed on top of the order map.
type DirectivesItem ¶
DirectivesItem represent single data from the Directives.
type Enumeration ¶
type Enumeration int
const ( Jsight Enumeration = iota Info Title Version Description Server BaseURL URL Get Post Put Patch Delete Body Request HTTPResponseCode Path Headers Query Type Enum Macro Paste // Include directive. // This directive will be processed before we build a directive tree, so you // won't see it. Include Protocol Method Params Result TAG Tags )
func NewDirectiveType ¶
func NewDirectiveType(s string) (Enumeration, error)
func (Enumeration) IsAllowedForDirectiveContext ¶
func (de Enumeration) IsAllowedForDirectiveContext(child Enumeration) bool
func (Enumeration) IsAllowedForRootContext ¶
func (de Enumeration) IsAllowedForRootContext() bool
func (Enumeration) IsHTTPRequestMethod ¶
func (de Enumeration) IsHTTPRequestMethod() bool
func (Enumeration) String ¶
func (de Enumeration) String() string
type IncludeTracer ¶
type IncludeTracer interface { // AddIncludeTraceToError adds proper trace to error. AddIncludeTraceToError(je *jerr.JApiError) }
IncludeTracer represent the directive's call stack.
Click to show internal directories.
Click to hide internal directories.