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) error
- func StatusSuccess(state *expand.State) response.Status
- func UpdateOutputParameterType(parameter *state.Parameter)
- func UpdateParameterAsyncType(parameter *state.Parameter)
- func UpdateParameterMetaType(parameter *state.Parameter)
- type Contract
- type Dispatcher
- type Input
- type Meta
- type ModelContextProtocol
- type Option
- func WithConstants(constants map[string]interface{}) Option
- func WithForm(form *hstate.Form) Option
- func WithHeader(header http.Header) Option
- func WithLogger(loger logger.Logger) Option
- func WithPath(pathParameters map[string]string) Option
- func WithQuery(query url.Values) Option
- func WithRequest(request *http.Request) Option
- type Options
- type Output
- func (o *Output) ContentType(format string) string
- func (o *Output) Excluded() map[string]bool
- func (r *Output) Field() string
- 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) IsExcluded(path string) bool
- 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 ¶
EnsureParameterTypes update output kind parameter type
func StatusSuccess ¶
TODO move it to some other package
func UpdateParameterMetaType ¶
Types ¶
type Contract ¶
type Contract struct {
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 Meta ¶ added in v0.16.2
type Meta struct {
Name string `json:",omitempty" yaml:"Name"` // name of the MCP
Description string `json:",omitempty" yaml:"Description"` // optional description for documentation purposes
DescriptionURI string `json:",omitempty" yaml:"DescriptionURI"`
}
MCP Model Configuration Protocol path integration
type ModelContextProtocol ¶ added in v0.16.2
type ModelContextProtocol struct {
MCPTool bool `json:",omitempty" yaml:"MCPTool"`
MCPResource bool `json:",omitempty" yaml:"MCPResource"`
MCPTemplateResource bool `json:",omitempty" yaml:"MCPTemplateResource"`
}
func (*ModelContextProtocol) HasMCPIntegration ¶ added in v0.16.2
func (m *ModelContextProtocol) HasMCPIntegration() bool
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 WithLogger ¶ added in v0.20.9
WithLogger adds path parameters
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
Logger logger.Logger
}
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"`
Title string `json:",omitempty"`
Exclude []string
NormalizeExclude *bool
DebugKind view.MetaKind
DataFormat string `json:",omitempty"` //default data format
RevealMetric *bool
Type state.Type
ViewType string
// contains filtered or unexported fields
}
func (*Output) ContentType ¶
func (*Output) IsExcluded ¶ added in v0.10.0
func (*Output) IsRevealMetric ¶
func (*Output) ShouldNormalizeExclude ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.