datahub

package
v1.141.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package datahub provides a DataHub toolkit adapter for the MCP data platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationConfig added in v0.20.0

type AnnotationConfig = toolkit.AnnotationConfig

AnnotationConfig holds tool annotation overrides from configuration.

type Config

type Config struct {
	URL             string                      `yaml:"url"`
	Token           string                      `yaml:"token"`
	Timeout         time.Duration               `yaml:"timeout"`
	DefaultLimit    int                         `yaml:"default_limit"`
	MaxLimit        int                         `yaml:"max_limit"`
	MaxLineageDepth int                         `yaml:"max_lineage_depth"`
	ConnectionName  string                      `yaml:"connection_name"`
	Debug           bool                        `yaml:"debug"`     // Enable debug logging
	ReadOnly        bool                        `yaml:"read_only"` // Restrict to read operations
	Titles          map[string]string           `yaml:"titles"`
	Descriptions    map[string]string           `yaml:"descriptions"`
	Annotations     map[string]AnnotationConfig `yaml:"annotations"`
}

Config holds DataHub toolkit configuration.

func ParseConfig

func ParseConfig(cfg map[string]any) (Config, error)

ParseConfig parses a DataHub toolkit configuration from a map.

type Toolkit

type Toolkit struct {
	// contains filtered or unexported fields
}

Toolkit wraps mcp-datahub toolkit for the platform.

func New

func New(name string, cfg Config) (*Toolkit, error)

New creates a new DataHub toolkit.

func (*Toolkit) Client

func (t *Toolkit) Client() *dhclient.Client

Client returns the underlying DataHub client for direct use.

func (*Toolkit) Close

func (t *Toolkit) Close() error

Close releases resources.

func (*Toolkit) Config

func (t *Toolkit) Config() Config

Config returns the toolkit configuration.

func (*Toolkit) Connection added in v0.12.1

func (t *Toolkit) Connection() string

Connection returns the connection name for audit logging.

func (*Toolkit) GetEntity added in v1.141.0

func (t *Toolkit) GetEntity(ctx context.Context, urn string) (*types.Entity, error)

GetEntity reads one entity through the toolkit's client, recorded as get_entity.

func (*Toolkit) GetGlossaryTerm added in v1.141.0

func (t *Toolkit) GetGlossaryTerm(ctx context.Context, urn string) (*types.GlossaryTerm, error)

GetGlossaryTerm reads one glossary term through the toolkit's client, recorded as get_glossary_term.

func (*Toolkit) IsReadOnly added in v1.133.4

func (t *Toolkit) IsReadOnly() bool

IsReadOnly reports whether this connection refuses write operations, for the enumeration that reports writability beside a connection (#1805). This toolkit serves one connection and lists none, so the fact is asked of the toolkit rather than read off a per-connection listing.

func (*Toolkit) Kind

func (*Toolkit) Kind() string

Kind returns the toolkit kind.

func (*Toolkit) Name

func (t *Toolkit) Name() string

Name returns the toolkit instance name.

func (*Toolkit) RegisterTools

func (t *Toolkit) RegisterTools(s *mcp.Server)

RegisterTools registers DataHub tools with the MCP server. The platform provides a unified list_connections tool, so the per-toolkit datahub_list_connections is excluded.

func (*Toolkit) SetMetrics added in v1.141.0

func (t *Toolkit) SetMetrics(m *observability.Metrics)

SetMetrics installs the recorder the toolkit's DataHub calls report to. The platform calls it on every toolkit that has one (WireToolkitMetrics) when metrics or tracing is on.

func (*Toolkit) SetQueryProvider

func (t *Toolkit) SetQueryProvider(provider query.Provider)

SetQueryProvider sets the query execution provider for enrichment.

func (*Toolkit) SetSemanticProvider

func (t *Toolkit) SetSemanticProvider(provider semantic.Provider)

SetSemanticProvider sets the semantic metadata provider for enrichment.

func (*Toolkit) Tools

func (t *Toolkit) Tools() []string

Tools returns the list of tool names that would be provided by this toolkit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL