Documentation
¶
Index ¶
- func IsAllowedForRootContext(child Enumeration) bool
- 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) 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) HasAnyParameters() bool
- func (d Directive) KeywordError(msg string) *jerr.JAPIError
- func (d Directive) Method() (Enumeration, error)
- func (d Directive) Parameter(k string) string
- func (d Directive) ParameterError(msg string) *jerr.JAPIError
- func (d Directive) Path() (string, error)
- func (d *Directive) SetParameter(k string, v string) error
- func (d Directive) String() string
- func (d Directive) Type() Enumeration
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAllowedForRootContext ¶
func IsAllowedForRootContext(child Enumeration) bool
func IsArrayOfTypes ¶
func IsHTTPResponseCode ¶
func IsStartWithDirective ¶
Types ¶
type Directive ¶
type Directive struct { Annotation string // Keyword only for Responses (have multiple keywords), for others should match // type. Keyword string 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 (*Directive) AppendChild ¶
func (Directive) BodyErrorIndex ¶
func (Directive) CopyWoParentAndChildren ¶
func (Directive) HasAnyParameters ¶
func (Directive) Method ¶
func (d Directive) Method() (Enumeration, error)
func (Directive) Type ¶
func (d Directive) Type() Enumeration
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 )
func NewDirectiveType ¶
func NewDirectiveType(s string) (Enumeration, error)
func (Enumeration) IsAllowedForDirectiveContext ¶
func (de Enumeration) IsAllowedForDirectiveContext(child Enumeration) bool
func (Enumeration) IsHTTPRequestMethod ¶
func (de Enumeration) IsHTTPRequestMethod() bool
func (Enumeration) String ¶
func (de Enumeration) String() string
Click to show internal directories.
Click to hide internal directories.