Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 86

Documentation

Overview

Package client defines the options used to configure Databricks API clients.

Databricks API clients can resolve their options from a variety of sources:

- Profile from file or default. - Environment variables override. - Explicit value override.

If no credentials are provided, the credentials are automatically resolved from the client configuration after the above chain of resolution.

In practice, we recommend users to stick to a single resolution level. That is either rely purely on automatic resolution from the environment or explicitly set all options in code. Mixing the two approaches is not recommended.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*internaloptions.ClientOptions) error

Option configures a Databricks API client.

func WithAccountID

func WithAccountID(id string) Option

WithAccountID returns an Option that sets the account ID for the client.

func WithConfigFile

func WithConfigFile(file string) Option

WithConfigFile returns an Option that sets the config file to use for profile resolution. By default, the config file is resolved from the environment variable $DATABRICKS_CONFIG_FILE. If file is empty, the returned Option returns an error when applied.

func WithCredentials

func WithCredentials(creds auth.Credentials) Option

WithCredentials returns an Option that sets a specific credentials.

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient returns an Option that uses a specific HTTP client when making HTTP requests.

Its transport and HTTP timeout are used unchanged.

func WithHost

func WithHost(h string) Option

WithHost returns an Option that sets the host for the client.

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger returns an Option that uses the provided logger. Log messages are only logged if the logger is enabled.

func WithProfile

func WithProfile(name string) Option

WithProfile returns an Option that sets the profile name to use for profile resolution. By default, the profile name is resolved from the environment variable $DATABRICKS_CONFIG_PROFILE. If name is empty, the returned Option returns an error when applied.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the default timeout for method execution, including retry delays and rate-limiter waits. It applies until the method returns. Override it with call.WithTimeout for a single method invocation. A zero duration disables the SDK timeout.

func WithWorkspaceID

func WithWorkspaceID(id string) Option

WithWorkspaceID returns an Option that sets the workspace ID for the client.

func WithoutConfigFile

func WithoutConfigFile() Option

WithoutConfigFile returns an Option that disables loading client configuration from a config file. It cannot be combined with WithConfigFile or WithProfile.

func WithoutEnv

func WithoutEnv() Option

WithoutEnv returns an Option that disables overlaying client configuration from environment variables. It does not affect DATABRICKS_CONFIG_FILE or DATABRICKS_CONFIG_PROFILE, which select the profile file and name.

Jump to

Keyboard shortcuts

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