Documentation ¶
Index ¶
- type Elem
- type ErrNotImplemented
- type ErrUnsupportedContentTypes
- type FileSystem
- type Generator
- type MethodRoute
- type Options
- type ResponseElem
- type Route
- type RouteNode
- func (n *RouteNode) Children() []*RouteNode
- func (n *RouteNode) Head() byte
- func (n *RouteNode) IsLeaf() bool
- func (n *RouteNode) IsParam() bool
- func (n *RouteNode) IsStatic() bool
- func (n *RouteNode) Operation() *ir.Operation
- func (n *RouteNode) Param() *ir.Parameter
- func (n *RouteNode) ParamChildren() (r []*RouteNode)
- func (n *RouteNode) ParamName() string
- func (n *RouteNode) Prefix() string
- func (n *RouteNode) StaticChildren() (r []*RouteNode)
- func (n *RouteNode) Tails() (r []byte)
- type RouteTree
- type Router
- type RouterElem
- type TemplateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elem ¶
type Elem struct { // Sub whether this Elem has parent Elem. Sub bool // Type is type of this Elem. Type *ir.Type // Var is decoding/encoding variable Go name (obj) or selector (obj.Field). Var string // Tag contains info about field tags, if any. Tag ir.Tag // First whether this field is first. First bool }
Elem variable helper for recursive array or object encoding or decoding.
type ErrNotImplemented ¶
type ErrNotImplemented struct {
Name string
}
func (*ErrNotImplemented) Error ¶
func (e *ErrNotImplemented) Error() string
type ErrUnsupportedContentTypes ¶
type ErrUnsupportedContentTypes struct {
ContentTypes []string
}
func (*ErrUnsupportedContentTypes) Error ¶
func (e *ErrUnsupportedContentTypes) Error() string
type FileSystem ¶
FileSystem represents a directory of generated package.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func (*Generator) WriteSource ¶
func (g *Generator) WriteSource(fs FileSystem, pkgName string) error
WriteSource writes generated definitions to fs.
type MethodRoute ¶ added in v0.7.0
MethodRoute is route for one Method.
func (*MethodRoute) Add ¶ added in v0.7.0
func (m *MethodRoute) Add(r Route) error
Add adds route to this tree.
type ResponseElem ¶
type ResponseElem struct { Response *ir.StatusResponse Ptr bool }
type RouteNode ¶ added in v0.7.0
type RouteNode struct {
// contains filtered or unexported fields
}
RouteNode is node of Radix tree of routes.
func (*RouteNode) ParamChildren ¶ added in v0.7.0
ParamChildren returns slice of child parameter nodes.
func (*RouteNode) StaticChildren ¶ added in v0.7.0
StaticChildren returns slice of child static nodes.
type RouteTree ¶ added in v0.7.0
type RouteTree struct {
Root *RouteNode
}
RouteTree is Radix tree of routes.
type Router ¶
type Router struct { Methods []MethodRoute // MaxParametersCount is maximum number of path parameters in one operation. MaxParametersCount int }
Router contains list of routes.
type RouterElem ¶ added in v0.8.0
type RouterElem struct { // ParameterIndex is index of parameter of this route part. ParameterIndex int Route *RouteNode }
RouterElem is variable helper for router generation.
type TemplateConfig ¶
type TemplateConfig struct { Package string Operations []*ir.Operation Types map[string]*ir.Type Interfaces map[string]*ir.Type Error *ir.StatusResponse ErrorType *ir.Type Router Router }
func (TemplateConfig) RegexStrings ¶ added in v0.5.0
func (t TemplateConfig) RegexStrings() (r []string)
RegexStrings returns slice of all unique regex validators.
Click to show internal directories.
Click to hide internal directories.