{"modulePath":"github.com/GoCodeAlone/workflow-plugin-data-engineering","version":"v0.3.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package catalog\n\nPackage catalog provides schema catalog modules (Schema Registry, etc.).\n\n## Functions\n\n```go\nfunc NewCatalogLineageQueryStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewCatalogLineageQueryStep creates a new step.catalog\\_lineage\\_query instance.\n\n```go\nfunc NewCatalogLineageStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewCatalogLineageStep creates a new step.catalog\\_lineage instance.\n\n```go\nfunc NewCatalogRegisterStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewCatalogRegisterStep creates a new step.catalog\\_register instance.\n\n```go\nfunc NewCatalogSearchStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewCatalogSearchStep creates a new step.catalog\\_search instance.\n\n```go\nfunc NewContractValidateStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewContractValidateStep creates a new step.contract\\_validate instance.\n\n```go\nfunc NewDataHubModule(name string, config map[string]any) (sdk.ModuleInstance, error)\n```\nNewDataHubModule creates a new catalog.datahub module.\n\n```go\nfunc NewOpenMetadataModule(name string, config map[string]any) (sdk.ModuleInstance, error)\n```\nNewOpenMetadataModule creates a new catalog.openmetadata module.\n\n```go\nfunc NewSchemaRegisterStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewSchemaRegisterStep creates a new step.schema\\_register instance.\n\n```go\nfunc NewSchemaRegistryModule(name string, config map[string]any) (sdk.ModuleInstance, error)\n```\nNewSchemaRegistryModule creates a new catalog.schema\\_registry module.\n\n```go\nfunc NewSchemaValidateStep(name string, _ map[string]any) (sdk.StepInstance, error)\n```\nNewSchemaValidateStep creates a new step.schema\\_validate instance.\n\n```go\nfunc RegisterCatalogModule(name string, m any) error\n```\nRegisterCatalogModule registers a DataHub or OpenMetadata module.\n\n```go\nfunc RegisterContractDB(name string, db ContractDB)\n```\nRegisterContractDB registers a ContractDB under a name for testing/wiring.\n\n```go\nfunc RegisterSRModule(name string, m *SchemaRegistryModule) error\n```\nRegisterSRModule registers a SchemaRegistryModule under the given name.\n\n```go\nfunc UnregisterCatalogModule(name string)\n```\nUnregisterCatalogModule removes a registered catalog module.\n\n```go\nfunc UnregisterContractDB(name string)\n```\nUnregisterContractDB removes a ContractDB from the registry.\n\n```go\nfunc UnregisterSRModule(name string)\n```\nUnregisterSRModule removes a registered SchemaRegistryModule.\n\n## Types\n\n```go\ntype CatalogDataset struct {\n\tName     string `json:\"name\"`\n\tPlatform string `json:\"platform\"`\n\tOwner    string `json:\"owner\"`\n}\n```\nCatalogDataset is a uniform dataset representation across catalog backends.\n\n```go\ntype CatalogProvider interface {\n\tRegisterDataset(ctx context.Context, req RegisterDatasetRequest) error\n\tSearchDatasets(ctx context.Context, query string, limit int) ([]CatalogDataset, int, error)\n}\n```\nCatalogProvider is the common interface for catalog backends (DataHub, OpenMetadata).\n\n```go\nfunc LookupCatalogProvider(name string) (CatalogProvider, error)\n```\nLookupCatalogProvider returns the CatalogProvider for the given module name.\n\n```go\ntype ContractDB interface {\n\tQueryCount(ctx context.Context, query string) (int, error)\n}\n```\nContractDB is an interface for executing SQL assertions during contract validation.\n\n```go\ntype ContractField struct {\n\tName     string `yaml:\"name\"`\n\tType     string `yaml:\"type\"`\n\tNullable bool   `yaml:\"nullable\"`\n\tRequired bool   `yaml:\"required\"`\n}\n```\nContractField describes a field in the contract schema.\n\n```go\ntype DataContract struct {\n\tDataset string          `yaml:\"dataset\"`\n\tVersion string          `yaml:\"version\"`\n\tSchema  []ContractField `yaml:\"schema\"`\n\tQuality []QualityCheck  `yaml:\"quality\"`\n}\n```\nDataContract is the YAML schema for a data contract file.\n\n```go\ntype DataHubClient interface {\n\tGetDataset(ctx context.Context, urn string) (*Dataset, error)\n\tSearchDatasets(ctx context.Context, query string, start, count int) (*SearchResult, error)\n\tEmitMetadata(ctx context.Context, proposals []MetadataProposal) error\n\tAddTag(ctx context.Context, urn, tag string) error\n\tAddGlossaryTerm(ctx context.Context, urn, term string) error\n\tSetOwner(ctx context.Context, urn, ownerUrn, ownerType string) error\n\tSetLineage(ctx context.Context, upstream, downstream string) error\n\tGetLineage(ctx context.Context, urn, direction string) (*LineageResult, error)\n}\n```\nDataHubClient is the interface for DataHub GMS REST API operations.\n\n```go\nfunc NewDataHubClient(endpoint, token string, timeout time.Duration) DataHubClient\n```\nNewDataHubClient creates a new DataHub HTTP client.\n\n```go\ntype DataHubConfig struct {\n\tEndpoint string        `json:\"endpoint\" yaml:\"endpoint\"`\n\tToken    string        `json:\"token\"    yaml:\"token\"`\n\tTimeout  time.Duration `json:\"timeout\"  yaml:\"timeout\"`\n}\n```\nDataHubConfig holds configuration for the catalog.datahub module.\n\n```go\ntype DataHubModule struct {\n\t// contains filtered or unexported fields\n}\n```\nDataHubModule implements the catalog.datahub module.\n\n```go\nfunc (m *DataHubModule) CatalogProvider() CatalogProvider\n```\nCatalogProvider returns this module as a CatalogProvider.\n\n```go\nfunc (m *DataHubModule) Client() DataHubClient\n```\nClient returns the underlying DataHubClient.\n\n```go\nfunc (m *DataHubModule) Init() error\n```\nInit validates configuration.\n\n```go\nfunc (m *DataHubModule) Start(_ context.Context) error\n```\nStart creates the client and registers the module.\n\n```go\nfunc (m *DataHubModule) Stop(_ context.Context) error\n```\nStop deregisters the module.\n\n```go\ntype Dataset struct {\n\tURN        string            `json:\"urn\"`\n\tName       string            `json:\"name\"`\n\tPlatform   string            `json:\"platform\"`\n\tSchema     *DatasetSchema    `json:\"schema,omitempty\"`\n\tProperties map[string]string `json:\"properties,omitempty\"`\n\tTags       []string          `json:\"tags,omitempty\"`\n\tOwner      string            `json:\"owner,omitempty\"`\n}\n```\nDataset represents a dataset entity in DataHub.\n\n```go\ntype DatasetRef struct {\n\tDataset  string\n\tPlatform string\n}\n```\nDatasetRef identifies a dataset by name and platform.\n\n```go\ntype DatasetSchema struct {\n\tFields []SchemaField `json:\"fields\"`\n}\n```\nDatasetSchema holds the schema fields of a dataset.\n\n```go\ntype EntityRef struct {\n\tFQN  string `json:\"fullyQualifiedName\"`\n\tType string `json:\"type\"`\n}\n```\nEntityRef is a lineage entity reference (FQN + type).\n\n```go\ntype LineageEdge struct {\n\tFrom     string `json:\"from\"`\n\tTo       string `json:\"to\"`\n\tPipeline string `json:\"pipeline\"`\n}\n```\nLineageEdge is a directed edge in the lineage graph.\n\n```go\ntype LineageNode struct {\n\tDataset  string `json:\"dataset\"`\n\tPlatform string `json:\"platform\"`\n\tDepth    int    `json:\"depth\"`\n}\n```\nLineageNode is a node in the lineage graph.\n\n```go\ntype LineageProvider interface {\n\tRecordLineage(ctx context.Context, upstreams, downstreams []DatasetRef, pipeline string) error\n\tQueryLineage(ctx context.Context, dataset, direction string, depth int) (*LineageQueryResult, error)\n}\n```\nLineageProvider is the interface for recording and querying dataset lineage.\n\n```go\nfunc LookupLineageProvider(name string) (LineageProvider, error)\n```\nLookupLineageProvider returns the LineageProvider for the named catalog module.\n\n```go\ntype LineageQueryResult struct {\n\tNodes []LineageNode\n\tEdges []LineageEdge\n}\n```\nLineageQueryResult holds the result of a lineage query.\n\n```go\ntype LineageResult struct {\n\tURN       string    `json:\"urn\"`\n\tDirection string    `json:\"direction\"`\n\tEntities  []Dataset `json:\"entities\"`\n}\n```\nLineageResult holds lineage information for a dataset.\n\n```go\ntype MetadataProposal struct {\n\tEntityURN  string         `json:\"entityUrn\"`\n\tAspectName string         `json:\"aspectName\"`\n\tAspect     map[string]any `json:\"aspect\"`\n}\n```\nMetadataProposal is a single aspect to emit to DataHub.\n\n```go\ntype OMColumn struct {\n\tName     string `json:\"name\"`\n\tDataType string `json:\"dataType\"`\n}\n```\nOMColumn is a single column in an OpenMetadata table.\n\n```go\ntype OMEntityRef struct {\n\tName string `json:\"name\"`\n\tType string `json:\"type\"`\n}\n```\nOMEntityRef is a reference to an entity (e.g. owner).\n\n```go\ntype OMLineageResult struct {\n\tFQN        string    `json:\"fullyQualifiedName\"`\n\tUpstream   []OMTable `json:\"upstream,omitempty\"`\n\tDownstream []OMTable `json:\"downstream,omitempty\"`\n}\n```\nOMLineageResult holds lineage information from OpenMetadata.\n\n```go\ntype OMSearchResult struct {\n\tTables []OMTable `json:\"tables\"`\n\tTotal  int       `json:\"total\"`\n}\n```\nOMSearchResult is the result of an OpenMetadata search query.\n\n```go\ntype OMTable struct {\n\tID                 string       `json:\"id,omitempty\"`\n\tName               string       `json:\"name\"`\n\tFullyQualifiedName string       `json:\"fullyQualifiedName,omitempty\"`\n\tDescription        string       `json:\"description,omitempty\"`\n\tColumns            []OMColumn   `json:\"columns,omitempty\"`\n\tTags               []OMTag      `json:\"tags,omitempty\"`\n\tOwner              *OMEntityRef `json:\"owner,omitempty\"`\n}\n```\nOMTable represents a table entity in OpenMetadata.\n\n```go\ntype OMTag struct {\n\tTagFQN string `json:\"tagFQN\"`\n}\n```\nOMTag is a tag attached to an entity in OpenMetadata.\n\n```go\ntype OpenMetadataClient interface {\n\tGetTable(ctx context.Context, fqn string) (*OMTable, error)\n\tSearchTables(ctx context.Context, query string, limit int) (*OMSearchResult, error)\n\tCreateOrUpdateTable(ctx context.Context, table OMTable) error\n\tAddTag(ctx context.Context, fqn, tag string) error\n\tSetOwner(ctx context.Context, fqn, owner string) error\n\tAddLineageEdge(ctx context.Context, from, to EntityRef) error\n\tGetLineage(ctx context.Context, fqn string) (*OMLineageResult, error)\n}\n```\nOpenMetadataClient is the interface for OpenMetadata REST API operations.\n\n```go\nfunc NewOpenMetadataClient(endpoint, token string, timeout time.Duration) OpenMetadataClient\n```\nNewOpenMetadataClient creates a new OpenMetadata HTTP client.\n\n```go\ntype OpenMetadataConfig struct {\n\tEndpoint string        `json:\"endpoint\" yaml:\"endpoint\"`\n\tToken    string        `json:\"token\"    yaml:\"token\"`\n\tTimeout  time.Duration `json:\"timeout\"  yaml:\"timeout\"`\n}\n```\nOpenMetadataConfig holds configuration for the catalog.openmetadata module.\n\n```go\ntype OpenMetadataModule struct {\n\t// contains filtered or unexported fields\n}\n```\nOpenMetadataModule implements the catalog.openmetadata module.\n\n```go\nfunc (m *OpenMetadataModule) CatalogProvider() CatalogProvider\n```\nCatalogProvider returns this module as a CatalogProvider.\n\n```go\nfunc (m *OpenMetadataModule) Client() OpenMetadataClient\n```\nClient returns the underlying OpenMetadataClient.\n\n```go\nfunc (m *OpenMetadataModule) Init() error\n```\nInit validates configuration.\n\n```go\nfunc (m *OpenMetadataModule) Start(_ context.Context) error\n```\nStart creates the client and registers the module.\n\n```go\nfunc (m *OpenMetadataModule) Stop(_ context.Context) error\n```\nStop deregisters the module.\n\n```go\ntype QualityCheck struct {\n\tName  string `yaml:\"name\"`\n\tQuery string `yaml:\"query\"` // must return 0 rows for passing\n\tType  string `yaml:\"type\"`  // not_null, unique, custom\n}\n```\nQualityCheck is a simple SQL-based quality assertion in the contract.\n\n```go\ntype RegisterDatasetRequest struct {\n\tDataset    string\n\tSchema     []SchemaField\n\tOwner      string\n\tTags       []string\n\tProperties map[string]string\n}\n```\nRegisterDatasetRequest carries all fields needed to register a dataset.\n\n```go\ntype SchemaDefinition struct {\n\tSchema     string            `json:\"schema\"               yaml:\"schema\"`\n\tSchemaType string            `json:\"schemaType,omitempty\" yaml:\"schemaType,omitempty\"`\n\tReferences []SchemaReference `json:\"references,omitempty\" yaml:\"references,omitempty\"`\n}\n```\nSchemaDefinition describes a schema to register or validate against.\n\n```go\ntype SchemaField struct {\n\tName     string `json:\"fieldPath\" yaml:\"name\"`\n\tType     string `json:\"nativeDataType\" yaml:\"type\"`\n\tNullable bool   `json:\"nullable\"       yaml:\"nullable\"`\n}\n```\nSchemaField is a single field in a dataset schema.\n\n```go\ntype SchemaInfo struct {\n\tSubject    string `json:\"subject\"              yaml:\"subject\"`\n\tVersion    int    `json:\"version\"              yaml:\"version\"`\n\tID         int    `json:\"id\"                   yaml:\"id\"`\n\tSchema     string `json:\"schema\"               yaml:\"schema\"`\n\tSchemaType string `json:\"schemaType,omitempty\" yaml:\"schemaType,omitempty\"`\n}\n```\nSchemaInfo is the full metadata returned for a registered schema.\n\n```go\ntype SchemaReference struct {\n\tName    string `json:\"name\"    yaml:\"name\"`\n\tSubject string `json:\"subject\" yaml:\"subject\"`\n\tVersion int    `json:\"version\" yaml:\"version\"`\n}\n```\nSchemaReference is a reference to another schema used in a schema definition.\n\n```go\ntype SchemaRegistryClient interface {\n\tListSubjects(ctx context.Context) ([]string, error)\n\tRegisterSchema(ctx context.Context, subject string, schema SchemaDefinition) (int, error)\n\tGetSchema(ctx context.Context, id int) (*SchemaDefinition, error)\n\tGetLatestSchema(ctx context.Context, subject string) (*SchemaInfo, error)\n\tGetSchemaByVersion(ctx context.Context, subject, version string) (*SchemaInfo, error)\n\tDeleteSubject(ctx context.Context, subject string, permanent bool) ([]int, error)\n\tCheckCompatibility(ctx context.Context, subject string, schema SchemaDefinition) (bool, error)\n\tGetCompatibilityLevel(ctx context.Context, subject string) (string, error)\n\tSetCompatibilityLevel(ctx context.Context, subject string, level string) error\n\tValidateSchema(ctx context.Context, schema SchemaDefinition, data []byte) error\n}\n```\nSchemaRegistryClient is the interface for Confluent Schema Registry REST API operations.\n\n```go\nfunc NewSchemaRegistryClient(endpoint, username, password string, timeout time.Duration) SchemaRegistryClient\n```\nNewSchemaRegistryClient creates a Schema Registry HTTP client.\n\n```go\ntype SchemaRegistryConfig struct {\n\tProvider             string        `json:\"provider\"             yaml:\"provider\"`\n\tEndpoint             string        `json:\"endpoint\"             yaml:\"endpoint\"`\n\tUsername             string        `json:\"username\"             yaml:\"username\"`\n\tPassword             string        `json:\"password\"             yaml:\"password\"`\n\tDefaultCompatibility string        `json:\"defaultCompatibility\" yaml:\"defaultCompatibility\"`\n\tTimeout              time.Duration `json:\"timeout\"              yaml:\"timeout\"`\n}\n```\nSchemaRegistryConfig holds configuration for the catalog.schema\\_registry module.\n\n```go\ntype SchemaRegistryModule struct {\n\t// contains filtered or unexported fields\n}\n```\nSchemaRegistryModule implements the catalog.schema\\_registry module.\n\n```go\nfunc LookupSRModule(name string) (*SchemaRegistryModule, error)\n```\nLookupSRModule returns the registered SchemaRegistryModule by name.\n\n```go\nfunc (m *SchemaRegistryModule) Client() SchemaRegistryClient\n```\nClient returns the underlying SchemaRegistryClient.\n\n```go\nfunc (m *SchemaRegistryModule) Config() SchemaRegistryConfig\n```\nConfig returns the module configuration.\n\n```go\nfunc (m *SchemaRegistryModule) Init() error\n```\nInit validates the module configuration.\n\n```go\nfunc (m *SchemaRegistryModule) Start(ctx context.Context) error\n```\nStart verifies connectivity by listing subjects, then registers the module.\n\n```go\nfunc (m *SchemaRegistryModule) Stop(_ context.Context) error\n```\nStop deregisters the module.\n\n```go\ntype SearchResult struct {\n\tEntities []Dataset `json:\"entities\"`\n\tTotal    int       `json:\"total\"`\n\tStart    int       `json:\"start\"`\n\tCount    int       `json:\"count\"`\n}\n```\nSearchResult is the result of a DataHub search query.\n\n","path":"github.com/GoCodeAlone/workflow-plugin-data-engineering/internal/catalog","name":"catalog","synopsis":"Package catalog provides schema catalog modules (Schema Registry, etc.).","isRedistributable":true}
