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:
- WORKBREW_BASE_URL: Custom base URL (defaults to https://console.workbrew.com)
- WORKBREW_API_VERSION: API version (defaults to v0)
Example:
client, err := workbrew.NewClientFromEnv()
func (*Client) GetLogger ¶
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 ¶
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")