datahub

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package datahub provides a DataHub implementation of the semantic provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements semantic.Provider using DataHub.

func New

func New(cfg Config) (*Adapter, error)

New creates a new DataHub adapter with a real client.

func NewWithClient

func NewWithClient(cfg Config, client Client) (*Adapter, error)

NewWithClient creates a new DataHub adapter with a provided client (for testing).

func (*Adapter) BuildURN

func (a *Adapter) BuildURN(_ context.Context, table semantic.TableIdentifier) (string, error)

BuildURN creates a URN from a table identifier.

func (*Adapter) Close

func (a *Adapter) Close() error

Close releases resources.

func (*Adapter) GetColumnContext

func (a *Adapter) GetColumnContext(ctx context.Context, column semantic.ColumnIdentifier) (*semantic.ColumnContext, error)

GetColumnContext retrieves column context from DataHub.

func (*Adapter) GetColumnsContext

func (a *Adapter) GetColumnsContext(ctx context.Context, table semantic.TableIdentifier) (map[string]*semantic.ColumnContext, error)

GetColumnsContext retrieves all columns context from DataHub.

func (*Adapter) GetGlossaryTerm

func (a *Adapter) GetGlossaryTerm(ctx context.Context, urn string) (*semantic.GlossaryTerm, error)

GetGlossaryTerm retrieves a glossary term from DataHub.

func (*Adapter) GetLineage

func (a *Adapter) GetLineage(ctx context.Context, table semantic.TableIdentifier, direction semantic.LineageDirection, maxDepth int) (*semantic.LineageInfo, error)

GetLineage retrieves lineage from DataHub.

func (*Adapter) GetTableContext

func (a *Adapter) GetTableContext(ctx context.Context, table semantic.TableIdentifier) (*semantic.TableContext, error)

GetTableContext retrieves table context from DataHub.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the provider name.

func (*Adapter) ResolveURN

func (a *Adapter) ResolveURN(_ context.Context, urn string) (*semantic.TableIdentifier, error)

ResolveURN converts a DataHub URN to a table identifier.

func (*Adapter) SearchTables

func (a *Adapter) SearchTables(ctx context.Context, filter semantic.SearchFilter) ([]semantic.TableSearchResult, error)

SearchTables searches for tables in DataHub.

type Client

type Client interface {
	Search(ctx context.Context, query string, opts ...dhclient.SearchOption) (*types.SearchResult, error)
	GetEntity(ctx context.Context, urn string) (*types.Entity, error)
	GetSchema(ctx context.Context, urn string) (*types.SchemaMetadata, error)
	GetLineage(ctx context.Context, urn string, opts ...dhclient.LineageOption) (*types.LineageResult, error)
	GetGlossaryTerm(ctx context.Context, urn string) (*types.GlossaryTerm, error)
	Ping(ctx context.Context) error
	Close() error
}

Client defines the interface for DataHub operations. This allows for mocking in tests.

type Config

type Config struct {
	URL      string
	Token    string
	Platform string // Default platform for URN building (e.g., "trino")
	Timeout  time.Duration
}

Config holds DataHub adapter configuration.

Jump to

Keyboard shortcuts

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