Documentation
¶
Index ¶
- func AgentInfo(w http.ResponseWriter, r *http.Request)
- func IsSupportedOrigin(origin string) bool
- func Ping(w http.ResponseWriter, _ *http.Request)
- func RegisterDatatugHandlers(pathPrefix string, router *httprouter.Router, mode RegisterMode, wrap wrapper, ...)
- type ApplicableEntry
- type ApplicableRequest
- type ApplicableResponse
- type ApplicableValue
- type BindingDTO
- type ColumnResolution
- type ColumnsResponse
- type ErrorResponse
- type Handler
- type NotYetEntry
- type ProjectAgentEndpoints
- type ProjectEndpoints
- type RegisterMode
- type RelatedEntry
- type RelatedResponse
- type RelatedRow
- type RelatedRowsResponse
- type VerifyRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentInfo ¶
func AgentInfo(w http.ResponseWriter, r *http.Request)
AgentInfo returns version of the agent
func IsSupportedOrigin ¶
IsSupportedOrigin check provided origin is allowed
func RegisterDatatugHandlers ¶
func RegisterDatatugHandlers( pathPrefix string, router *httprouter.Router, mode RegisterMode, wrap wrapper, contextProvider func(r *http.Request) (context.Context, error), handler Handler, )
RegisterDatatugHandlers registers datatug HTTP handlers
Types ¶
type ApplicableEntry ¶ added in v0.17.0
type ApplicableEntry struct {
Query string `json:"query"`
Bindings []BindingDTO `json:"bindings"`
Chain []string `json:"chain"`
}
ApplicableEntry is one query every required semantically-tagged parameter of which could be bound. Query is the query's ID (its ProjectItem.ID) — callers already have GET /datatug/queries/get_query to fetch the rest.
type ApplicableRequest ¶ added in v0.17.0
type ApplicableRequest struct {
Values []ApplicableValue `json:"values"`
}
ApplicableRequest is POST /datatug/queries/applicable's body: per the API contracts table, {values: [{entity, field, value, origin}]}. Origin is accepted (the web Investigation Context tags where a value came from) but not used by semantic.Applicable's own logic; it is not echoed back either, since Applicable does not thread it through.
type ApplicableResponse ¶ added in v0.17.0
type ApplicableResponse struct {
Applicable []ApplicableEntry `json:"applicable"`
NotYet []NotYetEntry `json:"notYet"`
}
ApplicableResponse is POST /datatug/queries/applicable's response: per the API contracts table, {applicable: [{query, bindings, chain}], notYet: [{query, missing}]}.
type ApplicableValue ¶ added in v0.17.0
type ApplicableValue struct {
Entity string `json:"entity"`
Field string `json:"field"`
Value any `json:"value"`
Source string `json:"source"`
Collection string `json:"collection"`
Column string `json:"column"`
Provenance string `json:"provenance"`
Origin string `json:"origin,omitempty"`
}
ApplicableValue is one semantic value on hand (the current selection, or an item from the Investigation Context). Source/Collection/Column/ Provenance are required: they are exactly semantic.SemanticValue's own required fields (used to attribute a bound parameter's origin in the resolution Chain), not optional metadata.
type BindingDTO ¶ added in v0.17.0
BindingDTO is one bound parameter.
type ColumnResolution ¶ added in v0.17.0
type ColumnResolution struct {
Column string `json:"column"`
Entity string `json:"entity,omitempty"`
Field string `json:"field,omitempty"`
Provenance string `json:"provenance,omitempty"`
Rule string `json:"rule,omitempty"`
Error string `json:"error,omitempty"`
}
ColumnResolution is one column's resolution. Error is set only when a column had NamePatterns candidates that failed to evaluate (e.g. invalid regexp) and nothing else resolved it — semantic.Resolution.Err's case; Entity/Field/Provenance/Rule are empty in that case.
type ColumnsResponse ¶ added in v0.17.0
type ColumnsResponse struct {
Columns []ColumnResolution `json:"columns"`
}
ColumnsResponse is GET /datatug/semantic/columns's body: per REQ:semantic- resolution-endpoint and the API contracts table, [{column, entity, field, provenance}] — Rule is this stream's own addition (brief item 1 lists it explicitly; it is directly available from semantic.Resolution.Rule and documents *why* a column resolved the way it did, useful beyond what the hub table's abbreviated shape shows).
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
Code string `json:"code,omitempty"`
Field string `json:"field,omitempty"`
}
ErrorResponse defines format of error response body. Code is set for a structured refusal (currently only "ACCESS_DENIED"); Field is reserved for a future per-field validation error and is not populated yet.
type Handler ¶
type Handler = func( w http.ResponseWriter, r *http.Request, requestDTO apicore.RequestDTO, verifyOptions verify.RequestOptions, successStatusCode int, getContext apicore.ContextProvider, handler apicore.Worker, )
Handler is responsible for creating context and call `handler()` func that should use provided context along with `requestDTO` that was populated from request body Its is exposed publicly so it can be replaced with custom implementation
type NotYetEntry ¶ added in v0.17.0
NotYetEntry is one query still missing at least one required semantically- tagged parameter.
type ProjectAgentEndpoints ¶
type ProjectAgentEndpoints struct {
}
ProjectAgentEndpoints defines project endpoints
type ProjectEndpoints ¶
type ProjectEndpoints interface {
CreateProject(w http.ResponseWriter, r *http.Request)
DeleteProject(w http.ResponseWriter, r *http.Request)
}
ProjectEndpoints defines project endpoints
type RegisterMode ¶
type RegisterMode = int
const ( RegisterWriteOnlyHandlers RegisterMode = iota RegisterAllHandlers )
type RelatedEntry ¶ added in v0.17.0
type RelatedEntry struct {
Label string `json:"label"`
Source string `json:"source"`
Collection string `json:"collection"`
Column string `json:"column"`
Kind string `json:"kind"`
Count *int `json:"count"`
LookupID string `json:"lookupId"`
}
RelatedEntry is one related-record path. Label defaults to Collection — semantic.Lookup carries no human title of its own, and no entity/board naming convention exists yet to derive a nicer one from; a caller free to override display text with something richer once one does.
Count is nil ("count unavailable" in the hub's own wording) whenever running the count query through the access-policy path reported any Limitation — a restricted count is not the true count, so REQ:related- lookup-execution's "count or count unavailable" is honoured by refusing to report a number that would misrepresent what an unrestricted caller would see. It is also nil if the count query itself failed (e.g. access denied outright): the /related endpoint reports "nothing to show", it does not fail the whole list over one lookup a principal cannot see at all.
type RelatedResponse ¶ added in v0.17.0
type RelatedResponse struct {
Related []RelatedEntry `json:"related"`
}
RelatedResponse is GET /datatug/semantic/related's body: per REQ:related- lookup-model and the API contracts table, [{label, source, collection, count|null, lookupId}]. Column/Kind are this stream's own addition, directly available from semantic.Lookup and useful for a caller (the web context panel) that wants to explain a lookup rather than just list it.
type RelatedRow ¶ added in v0.17.0
RelatedRow mirrors secureread.Row (Key/Data) under its own JSON tags — secureread.Row has none of its own (see PR body: modifying pkg/secureread, already merged by a concurrent lane, is outside this stream's scope).
type RelatedRowsResponse ¶ added in v0.17.0
type RelatedRowsResponse struct {
Columns []string `json:"columns"`
Rows []RelatedRow `json:"rows"`
Limitations []secureread.Limitation `json:"limitations"`
}
RelatedRowsResponse is GET /datatug/semantic/related/rows's body: per the API contracts table, "recordset + limitations".
type VerifyRequest ¶
VerifyRequest implements VerifyRequestOptions
func (VerifyRequest) AuthenticationRequired ¶
func (v VerifyRequest) AuthenticationRequired() bool
AuthenticationRequired specifies if authentication is mandatory
func (VerifyRequest) MaximumContentLength ¶
func (v VerifyRequest) MaximumContentLength() int64
MaximumContentLength defines max content length, if < 0 no limit
func (VerifyRequest) MinimumContentLength ¶
func (v VerifyRequest) MinimumContentLength() int64
MinimumContentLength defines min content length
Source Files
¶
- 0_interface.go
- agent_info_endpoint.go
- board_endpoints.go
- common.go
- constants.go
- dbserver_databases.go
- dbservers_endpoints.go
- entity_endpoints.go
- environment_endpoints.go
- execute_endpoints.go
- folder_endpoints.go
- ping_pong.go
- project_endpoints.go
- project_full.go
- projects.go
- query_endpoints.go
- recordsets_endpoints.go
- register.go
- routes.go
- semantic_applicable.go
- semantic_columns.go
- semantic_project.go
- semantic_related.go
- semantic_response.go
- semantic_schema.go
- semantic_session.go
- util_error_handling.go
- util_json.go
- validators.go