Documentation ¶
Index ¶
- func NewBody(opts ...Option) (kind.Locator, error)
- func NewConstants(opts ...Option) (kind.Locator, error)
- func NewContext(_ ...Option) (kind.Locator, error)
- func NewCookie(opts ...Option) (kind.Locator, error)
- func NewEnv(_ ...Option) (kind.Locator, error)
- func NewForm(opts ...Option) (kind.Locator, error)
- func NewGenerator(_ ...Option) (kind.Locator, error)
- func NewHeader(opts ...Option) (kind.Locator, error)
- func NewHttpRequest(opts ...Option) (kind.Locator, error)
- func NewObject(opts ...Option) (kind.Locator, error)
- func NewParameter(opts ...Option) (kind.Locator, error)
- func NewPath(opts ...Option) (kind.Locator, error)
- func NewQuery(opts ...Option) (kind.Locator, error)
- func NewRepeated(opts ...Option) (kind.Locator, error)
- func NewState(opts ...Option) (kind.Locator, error)
- func NewTransient(_ ...Option) (kind.Locator, error)
- func NewView(opts ...Option) (kind.Locator, error)
- func Register(kind state.Kind, newLocator NewLocator)
- type Body
- type Constants
- type Context
- type Cookie
- type DataView
- type Env
- type Form
- type Generator
- type Header
- type HttpRequest
- type KindLocator
- type NewLocator
- type Object
- type Option
- func WithBodyType(rType reflect.Type) Option
- func WithConstants(constants map[string]interface{}) Option
- func WithCustom(options ...interface{}) Option
- func WithDispatcher(dispatcher contract.Dispatcher) Option
- func WithForm(form *hstate.Form) Option
- func WithIOConfig(config *config.IOConfig) Option
- func WithInputParameters(parameters state.NamedParameters) Option
- func WithMetrics(metrics response.Metrics) Option
- func WithOutputParameters(parameters state.Parameters) Option
- func WithParameterLookup(lookupFn ParameterLookup) Option
- func WithParent(locators *KindLocator) Option
- func WithPathParameters(parameters map[string]string) Option
- func WithReadInto(fn ReadInto) Option
- func WithRequest(request *http.Request) Option
- func WithResource(resource *view.Resource) Option
- func WithState(state *structology.State) Option
- func WithTypes(types ...*state.Type) Option
- func WithURIPattern(URI string) Option
- func WithUnmarshal(fn func([]byte, interface{}) error) Option
- func WithView(aView *view.View) Option
- func WithViews(views view.NamedViews) Option
- type Options
- type Parameter
- type ParameterLookup
- type Path
- type Query
- type ReadInto
- type Repeated
- type State
- type Transient
- type Unmarshal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConstants ¶ added in v0.9.1
NewConstants returns body locator
func NewGenerator ¶
NewGenerator returns Generator locator
func NewHttpRequest ¶
NewHttpRequest returns http requestState locator
func NewParameter ¶
NewParameter returns parameter locator
func NewRepeated ¶
NewRepeated returns parameter locator
func NewTransient ¶
NewTransient returns Transient locator
func Register ¶
func Register(kind state.Kind, newLocator NewLocator)
Types ¶
type DataView ¶
type DataView struct { Views view.NamedViews ReadInto }
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
func (*HttpRequest) Names ¶
func (p *HttpRequest) Names() []string
type KindLocator ¶
KindLocator represents locators
func NewKindsLocator ¶
func NewKindsLocator(parent *KindLocator, options ...Option) *KindLocator
NewKindsLocator creates a locator
func (*KindLocator) Options ¶ added in v0.9.0
func (l *KindLocator) Options() []Option
func (*KindLocator) RemoveLocators ¶ added in v0.9.1
func (l *KindLocator) RemoveLocators(kind ...state.Kind)
func (*KindLocator) With ¶
func (l *KindLocator) With(options ...Option) *KindLocator
With creates sub locator with options
type Object ¶
type Object struct { ParameterLookup InputParameters state.NamedParameters OutputParameters state.NamedParameters }
type Option ¶
type Option func(o *Options)
Option represents locator option
func WithBodyType ¶
WithBodyType create Body Type option
func WithConstants ¶ added in v0.9.1
WithConstants return Constants option
func WithCustom ¶ added in v0.9.1
func WithCustom(options ...interface{}) Option
WithCustom creates custom options
func WithDispatcher ¶
func WithDispatcher(dispatcher contract.Dispatcher) Option
WithDispatcher returns options to set dispatcher
func WithIOConfig ¶
func WithInputParameters ¶
func WithInputParameters(parameters state.NamedParameters) Option
WithInputParameters creates with parameter options
func WithMetrics ¶
WithMetrics return metrics option
func WithOutputParameters ¶
func WithOutputParameters(parameters state.Parameters) Option
func WithParameterLookup ¶
func WithParameterLookup(lookupFn ParameterLookup) Option
WithParameterLookup creates with parameter options
func WithParent ¶
func WithParent(locators *KindLocator) Option
WithParent creates with parent options
func WithPathParameters ¶ added in v0.9.7
WithPathParameters create with path parameters options
func WithReadInto ¶
func WithRequest ¶
WithRequest create http requestState option
func WithResource ¶
WithResource return resource option
func WithState ¶
func WithState(state *structology.State) Option
WithState returns with satte options
func WithURIPattern ¶
WithURIPattern create Path pattern requestState
func WithUnmarshal ¶
WithUnmarshal creates with unmarshal options
type Options ¶
type Options struct { Parent *KindLocator URIPattern string BodyType reflect.Type Unmarshal Unmarshal IOConfig *config.IOConfig Custom []interface{} ParameterLookup ParameterLookup ReadInto ReadInto InputParameters state.NamedParameters OutputParameters state.NamedParameters Views view.NamedViews Metrics response.Metrics State *structology.State Dispatcher contract.Dispatcher View *view.View Resource *view.Resource Types []*state.Type PathParameters map[string]string Constants map[string]interface{} // contains filtered or unexported fields }
Options represents locator options
func NewOptions ¶
func (*Options) UnmarshalFunc ¶
type Parameter ¶
type Parameter struct { ParameterLookup Parameters state.NamedParameters }
type ParameterLookup ¶
type ParameterLookup func(ctx context.Context, parameter *state.Parameter) (interface{}, bool, error)
Options represents locator options
type Repeated ¶
type Repeated struct { ParameterLookup InputParameters state.NamedParameters OutputParameters state.NamedParameters }
type State ¶
type State struct {
State *structology.State
}