client

package
v0.0.0-dev Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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 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.

Important: When set, this option ignores all other options.

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_NAME.

func WithProfileFile

func WithProfileFile(file string) Option

WithProfileFile returns an Option that sets the profile file to use for profile resolution. By default, the profile file is resolved from the environment variable $DATABRICKS_CONFIG_FILE.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout returns an Option that sets the overall API call timeout to the given duration by default.

func WithWorkspaceID

func WithWorkspaceID(id string) Option

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

func WithoutProfileResolution

func WithoutProfileResolution() Option

WithoutProfileResolution returns an Option that entirely disables profile resolution. This is useful when you want your client to only be explicitly configured in code.

Jump to

Keyboard shortcuts

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