Documentation ¶
Index ¶
- Constants
- func DataOutputParameter(name string) *state.Parameter
- func DefaultDataOutputParameter() *state.Parameter
- func DefaultStatusOutputParameter() *state.Parameter
- func EnsureParameterTypes(parameters []*state.Parameter, aView *view.View, doc state.Documentation, ...) error
- func StatusSuccess(state *expand.State) response.Status
- func UpdateOutputParameterType(parameter *state.Parameter)
- func UpdateParameterAsyncType(parameter *state.Parameter)
- func UpdateParameterMetaType(parameter *state.Parameter)
- type BodySelector
- type Contract
- type Dispatcher
- type Input
- type Option
- type Options
- type Output
- func (o *Output) ContentType(format string) string
- func (o *Output) Excluded() map[string]bool
- func (o *Output) Format(query url.Values) string
- func (o *Output) GetTitle() string
- func (o *Output) Init(ctx context.Context, aView *view.View, inputType *state.Type, isReader bool) (err error)
- func (o *Output) IsRevealMetric() bool
- func (o *Output) ShouldNormalizeExclude() bool
- type Path
- type Style
Constants ¶
View Source
const (
FormatQuery = "_format"
)
Variables ¶
This section is empty.
Functions ¶
func DataOutputParameter ¶
func EnsureParameterTypes ¶
func EnsureParameterTypes(parameters []*state.Parameter, aView *view.View, doc state.Documentation, filterDoc state.Documentation) error
EnsureParameterTypes update output kind parameter type
func StatusSuccess ¶
TODO move it to some other package
func UpdateParameterMetaType ¶
Types ¶
type BodySelector ¶
type BodySelector struct {
StateValue string
}
BodySelector deprecated, use output parameter instead deprecated
type Contract ¶
type Contract struct { Name string `json:",omitempty" yaml:",omitempty"` Input Input Output Output ModulePath string Service service.Type `json:",omitempty"` }
func (*Contract) OutputType ¶
type Dispatcher ¶
type Dispatcher interface { //Dispatch dispatches request Dispatch(ctx context.Context, path *Path, options ...Option) (interface{}, error) }
Dispatcher represents a dispatcher
type Input ¶
type Option ¶ added in v0.9.2
type Option func(o *Options)
Option represents a dispatcher option
func WithConstants ¶ added in v0.9.2
WithConstants adds constants
func WithHeader ¶ added in v0.9.12
WithHeader adds header
func WithRequest ¶ added in v0.9.7
WithRequest adds request
type Options ¶ added in v0.9.2
type Options struct { Constants map[string]interface{} PathParameters map[string]string Query url.Values Header http.Header Form *hstate.Form Request *http.Request }
Options represents dispatcher options
func NewOptions ¶ added in v0.9.2
NewOptions creates a new options
type Output ¶
type Output struct { Cardinality state.Cardinality `json:",omitempty"` CaseFormat text.CaseFormat `json:",omitempty"` OmitEmpty bool `json:",omitempty"` Style Style `json:",omitempty"` Title string `json:",omitempty"` //Filed defines optional main view data holder //deprecated Field string `json:",omitempty"` Exclude []string NormalizeExclude *bool DebugKind view.MetaKind DataFormat string `json:",omitempty"` //default data format ResponseBody *BodySelector RevealMetric *bool Type state.Type ViewType string Doc state.Documentation FilterDoc state.Documentation // contains filtered or unexported fields }
func (*Output) ContentType ¶
func (*Output) IsRevealMetric ¶
func (*Output) ShouldNormalizeExclude ¶
Click to show internal directories.
Click to hide internal directories.