The official Go client for OpenMetadata — the open-source data catalog and metadata platform for data discovery, lineage, governance, data quality, and AI context.
Typed access to 50+ entity services (tables, dashboards, pipelines, glossaries, domains, data contracts, test cases, and more) with automatic pagination, retries, and JSON Patch support.
Looking for the Python SDK? It ships in the
openmetadata-ingestionpackage — see docs.open-metadata.org/latest/sdk/python. For AI agents and MCP, see ai-sdk. This repository is the Go client.
go get github.com/open-metadata/openmetadata-sdk/openmetadata-go-client@latestClient releases track OpenMetadata server versions — use the client version matching your server (server 1.13.x → client v1.13.x).
package main
import (
"context"
"fmt"
"log"
"github.com/open-metadata/openmetadata-sdk/openmetadata-go-client/pkg/ometa"
)
func main() {
client := ometa.NewClient(
"http://localhost:8585",
ometa.WithToken("<JWToken>"),
)
ctx := context.Background()
// Fetch a table by fully qualified name
table, err := client.Tables.GetByName(ctx, "sample_data.ecommerce_db.shopify.raw_product_catalog", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(table.Name)
// List returns an iterator — pagination is handled for you
for t, err := range client.Tables.List(ctx, nil) {
if err != nil {
log.Fatal(err)
}
fmt.Println(t.Name)
}
}Get a token from Settings → Bots → ingestion-bot in the OpenMetadata UI.
All 50+ services expose the same methods:
List · GetByID · GetByName · Create · CreateOrUpdate · Patch · Delete · DeleteByName · ListVersions · GetVersion · Restore
// Create
table, err := client.Tables.Create(ctx, &ometa.CreateTable{
Name: "my_table",
DatabaseSchema: "service.database.schema",
Columns: []ometa.Column{
{Name: "id", DataType: ometa.ColumnDataTypeINT},
{Name: "name", DataType: ometa.ColumnDataTypeSTRING},
},
})
// Patch (JSON Patch)
table, err = client.Tables.Patch(ctx, "<id>", []ometa.JSONPatchOp{
{Op: "add", Path: "/description", Value: "Updated description"},
})Services include: Tables, Topics, Dashboards, Pipelines, Charts, Containers, SearchIndexes, Metrics, StoredProcedures, Databases, DatabaseSchemas, APICollections, APIEndpoints, Glossaries, GlossaryTerms, Classifications, Tags, DataProducts, Domains, DataContracts, Policies, TestCases, TestSuites, TestDefinitions, Users, Teams, Roles, Personas, Bots, IngestionPipelines, EventSubscriptions, WorkflowDefinitions, and more.
| Option | Description | Default |
|---|---|---|
WithToken(token) |
Authentication token | "" |
WithAPIVersion(v) |
Override API version | "v1" |
WithRetry(count, wait) |
Retry behavior | 3 retries, 30s wait |
WithHTTPClient(c) |
Custom *http.Client |
Default http.Client |
Retries apply to 429 Too Many Requests and 504 Gateway Timeout.
Optional fields use pointers. Helpers are provided:
ometa.Str("value") // *string
ometa.Bool(true) // *bool
ometa.Int32(42) // *int32
ometa.Int64(42) // *int64
ometa.Float64(3.14) // *float64
ometa.Ptr(myValue) // *T (generic)- Full client reference:
openmetadata-go-client/README.md - Go package docs: https://pkg.go.dev/github.com/open-metadata/openmetadata-sdk/openmetadata-go-client
- OpenMetadata docs: https://docs.open-metadata.org/latest
- REST API: https://docs.open-metadata.org/latest/main-concepts/metadata-standard/apis
- Main project: https://github.com/open-metadata/OpenMetadata
Issues and pull requests welcome. Build and test targets are in the Makefile; run make help to list them.
Apache License 2.0