Skip to main content

Go SDK

We now present a high-level Go API as a gentle wrapper to interact with the OpenMetadata API. The open-source OpenMetadata SDK for Go simplifies provisioning, managing, and using OpenMetadata resources from the Go application code.
The OpenMetadata SDK for Go modules build on top of the underlying OpenMetadata REST API, allows you to use those APIs through familiar Go paradigms.
You can find the source code for the OpenMetadata libraries in the GitHub repository. As an open-source project, contributions are always welcome! You can add the module to your application with the below command

Create a Client

To talk to OpenMetadata, create a Client with the server address and, optionally, settings passed as options:
  • baseURL (first argument): the address where your OpenMetadata server is running, without the /api suffix (include the port if you need to, for example http://localhost:8585). The client adds /api/v1 itself.
  • WithToken(token): the JWT token used to authenticate every request.
  • WithAPIVersion(v): the API version to call. Defaults to v1, so you normally don’t set it.
  • WithRetry(count, wait): how many times to retry a request, and how long to wait between retries. Defaults to 3 retries, 30 seconds apart. The client retries a request when the server answers 429 or 504.
  • WithHTTPClient(c): use your own *http.Client, for example to set a proxy or custom TLS settings.
The client has one service for each entity type, such as client.Tables, client.Databases, and client.Users. For more information about the methods every service provides, see Go SDK - API Methods.