client

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory provides methods for creating configured SDK clients

func NewFactory

func NewFactory(defaultBaseURL string) *Factory

NewFactory creates a new SDK client factory

func (*Factory) NewClient

func (f *Factory) NewClient(opts Options) *dotenv.Client

NewClient creates a new SDK client with the provided options. Options is a config struct built a handful of times at startup, so passing it by value (gocritic hugeParam) is fine and keeps callers simple.

func (*Factory) NewClientFromAPIKey

func (f *Factory) NewClientFromAPIKey(apiKey, baseURL, organization string) *dotenv.Client

NewClientFromAPIKey creates an SDK client with API key authentication

func (*Factory) NewClientFromAccount

func (f *Factory) NewClientFromAccount(account *config.Account, includeOrg bool) (*dotenv.Client, error)

NewClientFromAccount creates an SDK client from a config.Account

func (*Factory) NewUnauthenticatedClient

func (f *Factory) NewUnauthenticatedClient(baseURL string, insecureSkipVerify bool) *dotenv.Client

NewUnauthenticatedClient creates an SDK client without authentication

func (*Factory) RefreshTokenAndCreateClient

func (f *Factory) RefreshTokenAndCreateClient(
	ctx context.Context,
	account *config.Account,
	am *config.AccountManager,
	includeOrg bool,
) (*dotenv.Client, error)

RefreshTokenAndCreateClient refreshes the token if needed and creates a client

type Options

type Options struct {
	// BaseURL is the API base URL
	BaseURL string

	// Authentication
	APIKey      string
	BearerToken string

	// Organization context
	Organization string

	// TLS configuration
	InsecureSkipVerify bool

	// TelemetrySecret HMAC-signs CLI telemetry requests. Empty ⇒ unsigned.
	TelemetrySecret string
}

Options contains configuration for creating SDK clients

Jump to

Keyboard shortcuts

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