sink

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sink defines where extracted metadata is written. The Sink interface is SDK-free so the workflow can be tested against a fake; the metadata-rest implementation translates the model into OpenMetadata SDK requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataREST

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

MetadataREST pushes entities to OpenMetadata via the official SDK. Every write uses CreateOrUpdate so re-running an ingestion is idempotent.

func (*MetadataREST) Close

func (m *MetadataREST) Close() error

Close is a no-op; the SDK client holds no long-lived resources to release.

func (*MetadataREST) UpsertDatabase

func (m *MetadataREST) UpsertDatabase(ctx context.Context, serviceFQN string, db *model.Database) (string, error)

func (*MetadataREST) UpsertSchema

func (m *MetadataREST) UpsertSchema(ctx context.Context, dbFQN string, schema *model.Schema) (string, error)

func (*MetadataREST) UpsertService

func (m *MetadataREST) UpsertService(ctx context.Context, svc *model.Service) (string, error)

func (*MetadataREST) UpsertTable

func (m *MetadataREST) UpsertTable(ctx context.Context, schemaFQN string, table *model.Table) (string, error)

type Sink

type Sink interface {
	UpsertService(ctx context.Context, svc *model.Service) (serviceFQN string, err error)
	UpsertDatabase(ctx context.Context, serviceFQN string, db *model.Database) (dbFQN string, err error)
	UpsertSchema(ctx context.Context, dbFQN string, schema *model.Schema) (schemaFQN string, err error)
	UpsertTable(ctx context.Context, schemaFQN string, table *model.Table) (tableFQN string, err error)
	// Close flushes and releases resources.
	Close() error
}

Sink persists the metadata hierarchy. Each method upserts one entity and returns the fully-qualified name of the entity it created/updated so the caller can pass it as the parent reference for the next level down.

func NewMetadataREST

func NewMetadataREST(cfg config.OpenMetadataServerConfig) (Sink, error)

NewMetadataREST builds a sink from the OpenMetadata server config. The JWT token must never be logged.

Jump to

Keyboard shortcuts

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