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 ¶
- type MetadataREST
- func (m *MetadataREST) Close() error
- func (m *MetadataREST) UpsertDatabase(ctx context.Context, serviceFQN string, db *model.Database) (string, error)
- func (m *MetadataREST) UpsertSchema(ctx context.Context, dbFQN string, schema *model.Schema) (string, error)
- func (m *MetadataREST) UpsertService(ctx context.Context, svc *model.Service) (string, error)
- func (m *MetadataREST) UpsertTable(ctx context.Context, schemaFQN string, table *model.Table) (string, error)
- type Sink
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 (*MetadataREST) UpsertSchema ¶
func (*MetadataREST) UpsertService ¶
func (*MetadataREST) UpsertTable ¶
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.