workbrew

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Services - users should only call methods on these services
	Analytics            *analytics.Service
	BrewCommands         *brewcommands.Service
	BrewConfigurations   *brewconfigurations.Service
	Brewfiles            *brewfiles.Service
	BrewTaps             *brewtaps.Service
	Casks                *casks.Service
	DeviceGroups         *devicegroups.Service
	Devices              *devices.Service
	Events               *events.Service
	Formulae             *formulae.Service
	Licenses             *licenses.Service
	Vulnerabilities      *vulnerabilities.Service
	VulnerabilityChanges *vulnerabilitychanges.Service
	// contains filtered or unexported fields
}

Client is the main entry point for the Workbrew API SDK. It aggregates all service clients and provides a unified interface. Users should interact with the API exclusively through the provided service methods.

func NewClient

func NewClient(apiKey string, workspaceName string, options ...client.ClientOption) (*Client, error)

NewClient creates a new Workbrew API client

Parameters:

  • apiKey: The bearer token for authentication
  • workspaceName: The workspace slug to operate on
  • options: Optional client configuration options

Example:

client, err := workbrew.NewClient(
    "your-api-key",
    "your-workspace",
    workbrew.WithDebug(),
)

func NewClientFromEnv

func NewClientFromEnv(options ...client.ClientOption) (*Client, error)

NewClientFromEnv creates a new client using environment variables

Required environment variables:

  • WORKBREW_API_KEY: The bearer token for authentication
  • WORKBREW_WORKSPACE: The workspace slug

Optional environment variables:

Example:

client, err := workbrew.NewClientFromEnv()

func (*Client) GetLogger

func (c *Client) GetLogger() *zap.Logger

GetLogger returns the configured zap logger instance. Use this to add custom logging within your application using the same logger.

Returns:

  • *zap.Logger: The configured logger instance

func (*Client) SetWorkspace

func (c *Client) SetWorkspace(workspaceName string)

SetWorkspace changes the active workspace for all subsequent API calls. This updates the base URL to target the specified workspace.

Parameters:

  • workspaceName: The name of the workspace to switch to

Example:

client.SetWorkspace("production-workspace")

Jump to

Keyboard shortcuts

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