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)
- func WithCubeComposeFrameContext(ctx context.Context, frame CubeComposeFrameContext) context.Context
- type Contract
- type CubeComposeFrameContext
- 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 PreparedQuery
- type QueryPreparer
- type Style
Constants ¶
const CubeComposeAlignmentElapsed = "elapsed"
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 ¶
func WithCubeComposeFrameContext ¶ added in v0.39.1
func WithCubeComposeFrameContext(ctx context.Context, frame CubeComposeFrameContext) context.Context
WithCubeComposeFrameContext attaches composition metadata to an internal frame preparation context.
Types ¶
type Contract ¶
type Contract struct {
Input Input
Output Output
ModulePath string
Service service.Type `json:",omitempty"`
}
func (*Contract) OutputType ¶
type CubeComposeFrameContext ¶ added in v0.39.1
CubeComposeFrameContext describes one internally prepared composition frame. Custom predicates may use it to align time windows while the Datly composition engine remains independent of business-specific calendars.
func CubeComposeFrameContextFrom ¶ added in v0.39.1
func CubeComposeFrameContextFrom(ctx context.Context) (CubeComposeFrameContext, bool)
CubeComposeFrameContextFrom returns composition metadata when query preparation is running as part of a CubeCompose request.
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:"MCPTool" 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 ¶
type Path ¶
type Path struct {
URI string `json:",omitempty" yaml:"URI"`
Method string `json:",omitempty" yaml:"Method"`
// contains filtered or unexported fields
}
func (*Path) HttpMethod ¶
type PreparedQuery ¶ added in v0.39.1
type PreparedQuery struct {
SQL string
Args []interface{}
}
PreparedQuery is a fully expanded, parameterized Datly reader query.
type QueryPreparer ¶ added in v0.39.1
type QueryPreparer interface {
PrepareQuery(ctx context.Context, path *Path, request *http.Request) (*PreparedQuery, error)
}
QueryPreparer is implemented by dispatchers that can prepare a reader route as a composable relation without executing it.