Documentation
¶
Overview ¶
Package platform provides the main platform orchestration.
Package platform provides the main platform orchestration.
Index ¶
- Constants
- func MigrateConfig(r io.Reader, w io.Writer, targetVersion string) error
- func MigrateConfigBytes(data []byte, targetVersion string) ([]byte, error)
- func PeekVersion(data []byte) string
- type APIKeyAuthConfig
- type APIKeyDef
- type AdminConfig
- type AppConfig
- type AuditConfig
- type AuthConfig
- type CSPAppConfig
- type CacheConfig
- type ClientLoggingConfig
- type Closer
- type Component
- type Config
- type ConfigEnvelope
- type ConfigStoreConfig
- type ConfigVersionInfo
- type DCRConfig
- type DatabaseConfig
- type Features
- type Info
- type InjectionConfig
- type KnowledgeApplyConfig
- type KnowledgeApplyInfo
- type KnowledgeConfig
- type Lifecycle
- func (l *Lifecycle) IsStarted() bool
- func (l *Lifecycle) OnStart(callback func(context.Context) error)
- func (l *Lifecycle) OnStop(callback func(context.Context) error)
- func (l *Lifecycle) RegisterCloser(c Closer)
- func (l *Lifecycle) RegisterComponent(c Component)
- func (l *Lifecycle) Start(ctx context.Context) error
- func (l *Lifecycle) Stop(ctx context.Context) error
- type MCPAppsConfig
- type OAuthClientConfig
- type OAuthConfig
- type OIDCAuthConfig
- type Option
- func WithAuditLogger(logger middleware.AuditLogger) Option
- func WithAuthenticator(auth middleware.Authenticator) Option
- func WithAuthorizer(authz middleware.Authorizer) Option
- func WithConfig(cfg *Config) Option
- func WithDB(db *sql.DB) Option
- func WithPersonaRegistry(reg *persona.Registry) Option
- func WithQueryProvider(provider query.Provider) Option
- func WithRuleEngine(engine *tuning.RuleEngine) Option
- func WithSemanticProvider(provider semantic.Provider) Option
- func WithSessionStore(store session.Store) Option
- func WithStorageProvider(provider storage.Provider) Option
- func WithToolkitRegistry(reg *registry.Registry) Option
- type Options
- type PersonaDef
- type PersonaInfo
- type PersonasConfig
- type Platform
- func (p *Platform) APIKeyAuthenticator() *auth.APIKeyAuthenticator
- func (p *Platform) AuditStore() *auditpostgres.Store
- func (p *Platform) Authenticator() middleware.Authenticator
- func (p *Platform) Close() error
- func (p *Platform) Config() *Config
- func (p *Platform) ConfigStore() configstore.Store
- func (p *Platform) HintManager() *tuning.HintManager
- func (p *Platform) KnowledgeChangesetStore() knowledgekit.ChangesetStore
- func (p *Platform) KnowledgeDataHubWriter() knowledgekit.DataHubWriter
- func (p *Platform) KnowledgeInsightStore() knowledgekit.InsightStore
- func (p *Platform) MCPServer() *mcp.Server
- func (p *Platform) OAuthServer() *oauth.Server
- func (p *Platform) PersonaRegistry() *persona.Registry
- func (*Platform) PlatformTools() []ToolInfo
- func (p *Platform) QueryProvider() query.Provider
- func (p *Platform) RuleEngine() *tuning.RuleEngine
- func (p *Platform) SemanticProvider() semantic.Provider
- func (p *Platform) SessionStore() session.Store
- func (p *Platform) Start(ctx context.Context) error
- func (p *Platform) Stop(ctx context.Context) error
- func (p *Platform) StorageProvider() storage.Provider
- func (p *Platform) ToolkitRegistry() *registry.Registry
- type ProgressConfig
- type PromptConfig
- type PromptsDef
- type QueryConfig
- type ResourcesConfig
- type RoleMappingConfig
- type RulesConfig
- type SemanticConfig
- type ServerConfig
- type SessionDedupConfig
- type SessionsConfig
- type ShutdownConfig
- type StorageConfig
- type StreamableConfig
- type TLSConfig
- type ToolInfo
- type ToolRulesDef
- type ToolsConfig
- type TuningConfig
- type URNMappingConfig
- type UpstreamIDPConfig
- type VersionConverter
- type VersionInfo
- type VersionRegistry
- type VersionStatus
Constants ¶
const ( SessionStoreMemory = "memory" SessionStoreDatabase = "database" )
Session store backend names.
const ( ConfigStoreModeFile = "file" ConfigStoreModeDatabase = "database" )
Config store mode names.
const CurrentConfigVersion = "v1"
CurrentConfigVersion is the current config API version.
Variables ¶
This section is empty.
Functions ¶
func MigrateConfig ¶ added in v0.16.0
MigrateConfig reads YAML from r, migrates it to targetVersion, and writes the result to w. If targetVersion is empty, the current version is used. Environment variable references (${VAR}) are preserved in the output.
func MigrateConfigBytes ¶ added in v0.16.0
MigrateConfigBytes migrates raw YAML config bytes to targetVersion. If targetVersion is empty, the current version is used. This function does NOT expand environment variables so ${VAR} references are preserved in the output.
func PeekVersion ¶ added in v0.16.0
PeekVersion extracts the apiVersion from raw YAML bytes. Returns "v1" if the field is missing or empty (backward compatibility).
Types ¶
type APIKeyAuthConfig ¶
APIKeyAuthConfig configures API key authentication.
type APIKeyDef ¶
type APIKeyDef struct {
Key string `yaml:"key"`
Name string `yaml:"name"`
Roles []string `yaml:"roles"`
}
APIKeyDef defines an API key.
type AdminConfig ¶ added in v0.17.0
type AdminConfig struct {
Enabled bool `yaml:"enabled"`
Portal bool `yaml:"portal"` // enable admin UI portal (default: false)
Persona string `yaml:"persona"` // required admin persona (default: "admin")
PathPrefix string `yaml:"path_prefix"` // URL prefix (default: "/api/v1/admin")
PortalTitle string `yaml:"portal_title"` // sidebar title (default: "Admin Portal")
}
AdminConfig configures the admin REST API.
type AppConfig ¶ added in v0.10.0
type AppConfig struct {
// Enabled controls whether this app is active.
Enabled bool `yaml:"enabled"`
// Tools lists the tool names this app attaches to.
Tools []string `yaml:"tools"`
// AssetsPath is the absolute filesystem path to the app's assets directory.
// This should point to a directory containing the app's HTML/JS/CSS files.
AssetsPath string `yaml:"assets_path"`
// ResourceURI is the MCP resource URI for this app (e.g., "ui://query-results").
// If not specified, defaults to "ui://<app-name>".
ResourceURI string `yaml:"resource_uri"`
// EntryPoint is the main HTML file within AssetsPath (e.g., "index.html").
// Defaults to "index.html" if not specified.
EntryPoint string `yaml:"entry_point"`
// CSP defines Content Security Policy requirements for the app.
CSP *CSPAppConfig `yaml:"csp"`
// Config holds app-specific configuration that will be injected
// into the HTML as JSON.
Config map[string]any `yaml:"config"`
}
AppConfig configures an individual MCP App.
type AuditConfig ¶
type AuditConfig struct {
Enabled bool `yaml:"enabled"`
LogToolCalls bool `yaml:"log_tool_calls"`
RetentionDays int `yaml:"retention_days"`
}
AuditConfig configures audit logging.
type AuthConfig ¶
type AuthConfig struct {
OIDC OIDCAuthConfig `yaml:"oidc"`
APIKeys APIKeyAuthConfig `yaml:"api_keys"`
AllowAnonymous bool `yaml:"allow_anonymous"` // default: false
}
AuthConfig configures authentication.
type CSPAppConfig ¶ added in v0.11.0
type CSPAppConfig struct {
// ResourceDomains lists origins for static resources (scripts, images, styles, fonts).
ResourceDomains []string `yaml:"resource_domains"`
// ConnectDomains lists origins for network requests (fetch/XHR/WebSocket).
ConnectDomains []string `yaml:"connect_domains"`
// FrameDomains lists origins for nested iframes.
FrameDomains []string `yaml:"frame_domains"`
// ClipboardWrite requests write access to the clipboard.
ClipboardWrite bool `yaml:"clipboard_write"`
}
CSPAppConfig defines Content Security Policy requirements for an MCP App.
type CacheConfig ¶
CacheConfig configures caching.
type ClientLoggingConfig ¶ added in v0.20.0
type ClientLoggingConfig struct {
Enabled bool `yaml:"enabled"`
}
ClientLoggingConfig configures server-to-client log message notifications.
type Config ¶
type Config struct {
APIVersion string `yaml:"apiVersion"`
ConfigStore ConfigStoreConfig `yaml:"config_store"`
Server ServerConfig `yaml:"server"`
Auth AuthConfig `yaml:"auth"`
OAuth OAuthConfig `yaml:"oauth"`
Database DatabaseConfig `yaml:"database"`
Personas PersonasConfig `yaml:"personas"`
Toolkits map[string]any `yaml:"toolkits"`
Tools ToolsConfig `yaml:"tools"`
Semantic SemanticConfig `yaml:"semantic"`
Query QueryConfig `yaml:"query"`
Storage StorageConfig `yaml:"storage"`
Injection InjectionConfig `yaml:"injection"`
Tuning TuningConfig `yaml:"tuning"`
Audit AuditConfig `yaml:"audit"`
MCPApps MCPAppsConfig `yaml:"mcpapps"`
Sessions SessionsConfig `yaml:"sessions"`
Knowledge KnowledgeConfig `yaml:"knowledge"`
Admin AdminConfig `yaml:"admin"`
Resources ResourcesConfig `yaml:"resources"`
Progress ProgressConfig `yaml:"progress"`
ClientLogging ClientLoggingConfig `yaml:"client_logging"`
}
Config holds the complete platform configuration.
func LoadConfig ¶
LoadConfig loads configuration from a file. The path is expected to come from command line arguments, controlled by the administrator.
func LoadConfigFromBytes ¶ added in v0.16.0
LoadConfigFromBytes loads configuration from raw YAML bytes. Environment variables are expanded before parsing. The apiVersion field is validated against the default version registry.
type ConfigEnvelope ¶ added in v0.16.0
type ConfigEnvelope struct {
APIVersion string `yaml:"apiVersion"`
}
ConfigEnvelope is a minimal struct for peeking at the apiVersion field without parsing the full config.
type ConfigStoreConfig ¶ added in v0.17.0
type ConfigStoreConfig struct {
Mode string `yaml:"mode"` // "file" (default) or "database"
}
ConfigStoreConfig configures how configuration is stored and managed.
type ConfigVersionInfo ¶ added in v0.16.0
type ConfigVersionInfo struct {
APIVersion string `json:"api_version"`
SupportedVersions []string `json:"supported_versions"`
LatestVersion string `json:"latest_version"`
}
ConfigVersionInfo provides information about the config API version.
type DCRConfig ¶
type DCRConfig struct {
Enabled bool `yaml:"enabled"`
AllowedRedirectPatterns []string `yaml:"allowed_redirect_patterns"`
}
DCRConfig configures Dynamic Client Registration.
type DatabaseConfig ¶
DatabaseConfig configures the database connection.
type Features ¶ added in v0.9.0
type Features struct {
SemanticEnrichment bool `json:"semantic_enrichment"`
QueryEnrichment bool `json:"query_enrichment"`
StorageEnrichment bool `json:"storage_enrichment"`
AuditLogging bool `json:"audit_logging"`
KnowledgeCapture bool `json:"knowledge_capture"`
KnowledgeApply *KnowledgeApplyInfo `json:"knowledge_apply,omitempty"`
}
Features describes enabled platform features.
type Info ¶ added in v0.14.0
type Info struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
AgentInstructions string `json:"agent_instructions,omitempty"`
Toolkits []string `json:"toolkits"`
Personas []PersonaInfo `json:"personas,omitempty"`
Features Features `json:"features"`
ConfigVersion ConfigVersionInfo `json:"config_version"`
}
Info contains information about the platform deployment.
type InjectionConfig ¶
type InjectionConfig struct {
TrinoSemanticEnrichment bool `yaml:"trino_semantic_enrichment"`
DataHubQueryEnrichment bool `yaml:"datahub_query_enrichment"`
S3SemanticEnrichment bool `yaml:"s3_semantic_enrichment"`
DataHubStorageEnrichment bool `yaml:"datahub_storage_enrichment"`
EstimateRowCounts bool `yaml:"estimate_row_counts"`
SessionDedup SessionDedupConfig `yaml:"session_dedup"`
}
InjectionConfig configures cross-injection.
type KnowledgeApplyConfig ¶ added in v0.16.0
type KnowledgeApplyConfig struct {
Enabled bool `yaml:"enabled"`
DataHubConnection string `yaml:"datahub_connection"`
RequireConfirmation bool `yaml:"require_confirmation"`
}
KnowledgeApplyConfig configures the apply_knowledge tool.
type KnowledgeApplyInfo ¶ added in v0.16.0
type KnowledgeApplyInfo struct {
Enabled bool `json:"enabled"`
DataHubConnection string `json:"datahub_connection,omitempty"`
}
KnowledgeApplyInfo provides information about the knowledge apply feature.
type KnowledgeConfig ¶ added in v0.16.0
type KnowledgeConfig struct {
Enabled bool `yaml:"enabled"`
Apply KnowledgeApplyConfig `yaml:"apply"`
}
KnowledgeConfig configures the knowledge capture feature.
type Lifecycle ¶
type Lifecycle struct {
// contains filtered or unexported fields
}
Lifecycle manages the startup and shutdown of platform components.
func (*Lifecycle) RegisterCloser ¶
RegisterCloser registers a closer to be closed on shutdown.
func (*Lifecycle) RegisterComponent ¶
RegisterComponent registers a component with the lifecycle.
type MCPAppsConfig ¶ added in v0.10.0
type MCPAppsConfig struct {
// Enabled is the master switch for MCP Apps support.
Enabled bool `yaml:"enabled"`
// Apps configures individual MCP Apps.
Apps map[string]AppConfig `yaml:"apps"`
}
MCPAppsConfig configures MCP Apps support for interactive UI components.
type OAuthClientConfig ¶ added in v0.3.0
type OAuthClientConfig struct {
ID string `yaml:"id"`
Secret string `yaml:"secret"`
RedirectURIs []string `yaml:"redirect_uris"`
}
OAuthClientConfig defines a pre-registered OAuth client.
type OAuthConfig ¶
type OAuthConfig struct {
Enabled bool `yaml:"enabled"`
Issuer string `yaml:"issuer"`
SigningKey string `yaml:"signing_key"` // Base64-encoded HMAC key for JWT signing
Clients []OAuthClientConfig `yaml:"clients"`
DCR DCRConfig `yaml:"dcr"`
Upstream *UpstreamIDPConfig `yaml:"upstream,omitempty"`
}
OAuthConfig configures the OAuth server.
type OIDCAuthConfig ¶
type OIDCAuthConfig struct {
Enabled bool `yaml:"enabled"`
Issuer string `yaml:"issuer"`
ClientID string `yaml:"client_id"`
Audience string `yaml:"audience"`
RoleClaimPath string `yaml:"role_claim_path"`
RolePrefix string `yaml:"role_prefix"`
}
OIDCAuthConfig configures OIDC authentication.
type Option ¶
type Option func(*Options)
Option is a functional option for configuring the platform.
func WithAuditLogger ¶
func WithAuditLogger(logger middleware.AuditLogger) Option
WithAuditLogger sets the audit logger.
func WithAuthenticator ¶
func WithAuthenticator(auth middleware.Authenticator) Option
WithAuthenticator sets the authenticator.
func WithAuthorizer ¶
func WithAuthorizer(authz middleware.Authorizer) Option
WithAuthorizer sets the authorizer.
func WithPersonaRegistry ¶
WithPersonaRegistry sets the persona registry.
func WithQueryProvider ¶
WithQueryProvider sets the query provider.
func WithRuleEngine ¶
func WithRuleEngine(engine *tuning.RuleEngine) Option
WithRuleEngine sets the rule engine.
func WithSemanticProvider ¶
WithSemanticProvider sets the semantic provider.
func WithSessionStore ¶ added in v0.15.0
WithSessionStore sets the session store.
func WithStorageProvider ¶
WithStorageProvider sets the storage provider.
func WithToolkitRegistry ¶
WithToolkitRegistry sets the toolkit registry.
type Options ¶
type Options struct {
// Config is the platform configuration.
Config *Config
// Database connection (optional, will be created from config if not provided).
DB *sql.DB
// SemanticProvider (optional, will be created from config if not provided).
SemanticProvider semantic.Provider
// QueryProvider (optional, will be created from config if not provided).
QueryProvider query.Provider
// StorageProvider (optional, will be created from config if not provided).
StorageProvider storage.Provider
// Authenticator (optional, will be created from config if not provided).
Authenticator middleware.Authenticator
// Authorizer (optional, will be created from config if not provided).
Authorizer middleware.Authorizer
// AuditLogger (optional, will be created from config if not provided).
AuditLogger middleware.AuditLogger
// PersonaRegistry (optional, will be created from config if not provided).
PersonaRegistry *persona.Registry
// ToolkitRegistry (optional, will be created if not provided).
ToolkitRegistry *registry.Registry
// RuleEngine (optional, will be created from config if not provided).
RuleEngine *tuning.RuleEngine
// SessionStore (optional, will be created from config if not provided).
SessionStore session.Store
}
Options configures the platform.
type PersonaDef ¶
type PersonaDef struct {
DisplayName string `yaml:"display_name"`
Description string `yaml:"description,omitempty"`
Roles []string `yaml:"roles"`
Tools ToolRulesDef `yaml:"tools"`
Prompts PromptsDef `yaml:"prompts"`
Hints map[string]string `yaml:"hints,omitempty"`
Priority int `yaml:"priority,omitempty"`
}
PersonaDef defines a persona.
type PersonaInfo ¶ added in v0.12.0
type PersonaInfo struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description,omitempty"`
}
PersonaInfo provides summary information about a persona.
type PersonasConfig ¶
type PersonasConfig struct {
Definitions map[string]PersonaDef `yaml:",inline"`
DefaultPersona string `yaml:"default_persona"`
RoleMapping RoleMappingConfig `yaml:"role_mapping"`
}
PersonasConfig holds persona definitions.
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform is the main platform facade.
func (*Platform) APIKeyAuthenticator ¶ added in v0.17.0
func (p *Platform) APIKeyAuthenticator() *auth.APIKeyAuthenticator
APIKeyAuthenticator returns the API key authenticator, or nil if API keys are disabled.
func (*Platform) AuditStore ¶ added in v0.17.0
func (p *Platform) AuditStore() *auditpostgres.Store
AuditStore returns the PostgreSQL audit store, or nil if audit is disabled.
func (*Platform) Authenticator ¶ added in v0.17.0
func (p *Platform) Authenticator() middleware.Authenticator
Authenticator returns the platform authenticator.
func (*Platform) Close ¶
Close closes all platform resources in the correct order:
- Flush enrichment state, stop session cache, close session store
- Close audit logger + audit store (goroutine stops, can still use DB)
- Close providers and toolkit registry (trino, datahub, s3)
- Close database connection (last — nothing else needs it)
func (*Platform) ConfigStore ¶ added in v0.17.0
func (p *Platform) ConfigStore() configstore.Store
ConfigStore returns the config store.
func (*Platform) HintManager ¶ added in v0.12.0
func (p *Platform) HintManager() *tuning.HintManager
HintManager returns the hint manager.
func (*Platform) KnowledgeChangesetStore ¶ added in v0.17.0
func (p *Platform) KnowledgeChangesetStore() knowledgekit.ChangesetStore
KnowledgeChangesetStore returns the changeset store, or nil if knowledge apply is disabled.
func (*Platform) KnowledgeDataHubWriter ¶ added in v0.17.0
func (p *Platform) KnowledgeDataHubWriter() knowledgekit.DataHubWriter
KnowledgeDataHubWriter returns the DataHub writer, or nil if knowledge apply is disabled.
func (*Platform) KnowledgeInsightStore ¶ added in v0.17.0
func (p *Platform) KnowledgeInsightStore() knowledgekit.InsightStore
KnowledgeInsightStore returns the insight store, or nil if knowledge is disabled.
func (*Platform) OAuthServer ¶ added in v0.3.0
OAuthServer returns the OAuth server, or nil if not enabled.
func (*Platform) PersonaRegistry ¶
PersonaRegistry returns the persona registry.
func (*Platform) PlatformTools ¶ added in v0.18.2
PlatformTools returns tools registered directly on the platform outside of any toolkit.
func (*Platform) QueryProvider ¶
QueryProvider returns the query provider.
func (*Platform) RuleEngine ¶
func (p *Platform) RuleEngine() *tuning.RuleEngine
RuleEngine returns the rule engine.
func (*Platform) SemanticProvider ¶
SemanticProvider returns the semantic provider.
func (*Platform) SessionStore ¶ added in v0.15.0
SessionStore returns the session store.
func (*Platform) StorageProvider ¶
StorageProvider returns the storage provider.
func (*Platform) ToolkitRegistry ¶
ToolkitRegistry returns the toolkit registry.
type ProgressConfig ¶ added in v0.20.0
type ProgressConfig struct {
Enabled bool `yaml:"enabled"`
}
ProgressConfig configures progress notifications during tool execution.
type PromptConfig ¶ added in v0.11.0
type PromptConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Content string `yaml:"content"`
}
PromptConfig defines a platform-level MCP prompt.
type PromptsDef ¶
type PromptsDef struct {
SystemPrefix string `yaml:"system_prefix,omitempty"`
SystemSuffix string `yaml:"system_suffix,omitempty"`
Instructions string `yaml:"instructions,omitempty"`
}
PromptsDef defines prompt customizations.
type QueryConfig ¶
type QueryConfig struct {
Provider string `yaml:"provider"` // "trino", "noop"
Instance string `yaml:"instance"`
URNMapping URNMappingConfig `yaml:"urn_mapping"`
}
QueryConfig configures the query provider.
type ResourcesConfig ¶ added in v0.20.0
type ResourcesConfig struct {
Enabled bool `yaml:"enabled"`
}
ResourcesConfig configures MCP resource templates.
type RoleMappingConfig ¶
type RoleMappingConfig struct {
OIDCToPersona map[string]string `yaml:"oidc_to_persona"`
UserPersonas map[string]string `yaml:"user_personas"`
}
RoleMappingConfig configures role mapping.
type RulesConfig ¶
type RulesConfig struct {
RequireDataHubCheck bool `yaml:"require_datahub_check"`
WarnOnDeprecated bool `yaml:"warn_on_deprecated"`
QualityThreshold float64 `yaml:"quality_threshold"`
}
RulesConfig configures operational rules.
type SemanticConfig ¶
type SemanticConfig struct {
Provider string `yaml:"provider"` // "datahub", "noop"
Instance string `yaml:"instance"`
Cache CacheConfig `yaml:"cache"`
URNMapping URNMappingConfig `yaml:"urn_mapping"`
Lineage datahubsemantic.LineageConfig `yaml:"lineage"`
}
SemanticConfig configures the semantic layer.
type ServerConfig ¶
type ServerConfig struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description"`
Tags []string `yaml:"tags"` // Discovery keywords for routing
AgentInstructions string `yaml:"agent_instructions"` // Inline operational guidance for AI agents
Prompts []PromptConfig `yaml:"prompts"` // Platform-level MCP prompts
Transport string `yaml:"transport"` // "stdio", "http" (or "sse" for backward compat)
Address string `yaml:"address"`
TLS TLSConfig `yaml:"tls"`
Streamable StreamableConfig `yaml:"streamable"`
Shutdown ShutdownConfig `yaml:"shutdown"`
}
ServerConfig configures the MCP server.
type SessionDedupConfig ¶ added in v0.14.0
type SessionDedupConfig struct {
// Enabled controls whether session dedup is active. Defaults to true.
Enabled *bool `yaml:"enabled"`
// Mode controls what is sent for previously-enriched tables.
// Values: "reference" (default), "summary", "none".
Mode string `yaml:"mode"`
// EntryTTL is how long a table's enrichment is considered fresh.
// Defaults to the semantic cache TTL (typically 5m).
EntryTTL time.Duration `yaml:"entry_ttl"`
// SessionTimeout is how long an idle session persists before cleanup.
// Defaults to the server's streamable session timeout (typically 30m).
SessionTimeout time.Duration `yaml:"session_timeout"`
}
SessionDedupConfig configures session-level metadata deduplication.
func (*SessionDedupConfig) EffectiveMode ¶ added in v0.14.0
func (c *SessionDedupConfig) EffectiveMode() string
EffectiveMode returns the dedup mode, defaulting to "reference".
func (*SessionDedupConfig) IsEnabled ¶ added in v0.14.0
func (c *SessionDedupConfig) IsEnabled() bool
IsEnabled returns whether session dedup is enabled, defaulting to true.
type SessionsConfig ¶ added in v0.15.0
type SessionsConfig struct {
// Store selects the session storage backend: "memory" (default) or "database".
Store string `yaml:"store"`
// TTL is the session lifetime. Defaults to streamable.session_timeout.
TTL time.Duration `yaml:"ttl"`
// IdleTimeout is the idle session eviction threshold.
// Defaults to streamable.session_timeout.
IdleTimeout time.Duration `yaml:"idle_timeout"`
// CleanupInterval is how often the cleanup routine runs. Defaults to 1m.
CleanupInterval time.Duration `yaml:"cleanup_interval"`
}
SessionsConfig configures session externalization.
type ShutdownConfig ¶ added in v0.15.0
type ShutdownConfig struct {
// GracePeriod is the maximum time to drain in-flight requests after
// receiving a shutdown signal. Defaults to 25s (fits within K8s 30s
// terminationGracePeriodSeconds with headroom for pre-shutdown delay).
GracePeriod time.Duration `yaml:"grace_period"`
// PreShutdownDelay is the time to sleep after marking the pod as
// not-ready and before starting the HTTP drain. This gives the K8s
// load balancer time to deregister the pod. Defaults to 2s.
PreShutdownDelay time.Duration `yaml:"pre_shutdown_delay"`
}
ShutdownConfig configures graceful shutdown timing.
type StorageConfig ¶
type StorageConfig struct {
Provider string `yaml:"provider"` // "s3", "noop"
Instance string `yaml:"instance"`
}
StorageConfig configures the storage provider.
type StreamableConfig ¶ added in v0.13.0
type StreamableConfig struct {
// SessionTimeout is how long an idle session persists before cleanup.
// Defaults to 30 minutes.
SessionTimeout time.Duration `yaml:"session_timeout"`
// Stateless disables session tracking (no Mcp-Session-Id validation).
Stateless bool `yaml:"stateless"`
}
StreamableConfig configures the Streamable HTTP transport.
type TLSConfig ¶
type TLSConfig struct {
Enabled bool `yaml:"enabled"`
CertFile string `yaml:"cert_file"`
KeyFile string `yaml:"key_file"`
}
TLSConfig configures TLS.
type ToolInfo ¶ added in v0.18.2
ToolInfo describes a tool registered directly on the platform (not via a toolkit).
type ToolRulesDef ¶
ToolRulesDef defines tool access rules.
type ToolsConfig ¶ added in v0.18.0
ToolsConfig configures global tool visibility filtering for tools/list responses. This is a visibility filter to reduce token usage — not a security boundary. Persona auth continues to gate tools/call independently.
type TuningConfig ¶
type TuningConfig struct {
Rules RulesConfig `yaml:"rules"`
PromptsDir string `yaml:"prompts_dir"`
}
TuningConfig configures AI tuning.
type URNMappingConfig ¶ added in v0.6.0
type URNMappingConfig struct {
// Platform overrides the platform name used in DataHub URN building.
// For example, if Trino queries a PostgreSQL database, set this to "postgres"
// so URNs match DataHub's platform identifier.
Platform string `yaml:"platform"`
// CatalogMapping maps catalog names between systems.
// For semantic provider: maps Trino catalogs to DataHub catalogs (rdbms → warehouse)
// For query provider: maps DataHub catalogs to Trino catalogs (warehouse → rdbms)
CatalogMapping map[string]string `yaml:"catalog_mapping"`
}
URNMappingConfig configures URN translation between query engines and metadata catalogs. This is necessary when Trino catalog/platform names differ from DataHub's metadata catalog names.
type UpstreamIDPConfig ¶ added in v0.3.0
type UpstreamIDPConfig struct {
Issuer string `yaml:"issuer"` // Keycloak issuer URL
ClientID string `yaml:"client_id"` // MCP Server's client ID in Keycloak
ClientSecret string `yaml:"client_secret"` // MCP Server's client secret
RedirectURI string `yaml:"redirect_uri"` // Callback URL (e.g., http://localhost:8080/oauth/callback)
}
UpstreamIDPConfig configures the upstream identity provider (e.g., Keycloak).
type VersionConverter ¶ added in v0.16.0
VersionConverter converts raw YAML bytes directly to the latest Config. A nil converter means the version uses standard YAML unmarshalling.
type VersionInfo ¶ added in v0.16.0
type VersionInfo struct {
// Version is the version string (e.g., "v1").
Version string
// Status is the lifecycle state of this version.
Status VersionStatus
// DeprecationMessage is shown when a deprecated version is loaded.
DeprecationMessage string
// MigrationGuide is shown when a removed version is loaded.
MigrationGuide string
// Converter transforms raw YAML bytes into a Config. Nil means
// standard YAML unmarshalling is used (i.e., the version matches
// the current schema).
Converter VersionConverter
}
VersionInfo describes a config API version.
type VersionRegistry ¶ added in v0.16.0
type VersionRegistry struct {
// contains filtered or unexported fields
}
VersionRegistry holds known config API versions.
func DefaultRegistry ¶ added in v0.16.0
func DefaultRegistry() *VersionRegistry
DefaultRegistry returns the standard version registry with v1 registered.
func NewVersionRegistry ¶ added in v0.16.0
func NewVersionRegistry() *VersionRegistry
NewVersionRegistry creates an empty version registry.
func (*VersionRegistry) Current ¶ added in v0.16.0
func (r *VersionRegistry) Current() string
Current returns the current version string.
func (*VersionRegistry) Get ¶ added in v0.16.0
func (r *VersionRegistry) Get(version string) (*VersionInfo, bool)
Get returns the version info for the given version string.
func (*VersionRegistry) IsDeprecated ¶ added in v0.16.0
func (r *VersionRegistry) IsDeprecated(version string) bool
IsDeprecated returns true if the version exists and is deprecated.
func (*VersionRegistry) ListSupported ¶ added in v0.16.0
func (r *VersionRegistry) ListSupported() []string
ListSupported returns all non-removed version strings, sorted.
func (*VersionRegistry) Register ¶ added in v0.16.0
func (r *VersionRegistry) Register(info *VersionInfo)
Register adds a version to the registry. If current is empty and this is the first VersionCurrent entry, it becomes the current version.
type VersionStatus ¶ added in v0.16.0
type VersionStatus int
VersionStatus represents the lifecycle state of a config version.
const ( // VersionCurrent is an actively supported version. VersionCurrent VersionStatus = iota // VersionDeprecated is a version that still works but emits warnings. VersionDeprecated // VersionRemoved is a version that is no longer supported. VersionRemoved )
func (VersionStatus) String ¶ added in v0.16.0
func (s VersionStatus) String() string
String returns a human-readable representation of the version status.