Skip to content

deploymenttheory/go-api-sdk-workbrew

Go SDK for Workbrew API

Go Report Card GoDoc License Go Version Release codecov Tests Status: Stable

A community Go client library for the Workbrew API v0.

Quick Start

Get started quickly with the SDK using the Quick Start Guide, which includes:

  • Installation instructions
  • Your first API call
  • Common operations (devices, brewfiles, analytics)
  • Error handling patterns
  • Response metadata access
  • CSV export examples
  • Links to configuration guides for production use

Examples

The examples directory contains complete working examples for all SDK features:

SDK Services

Device Management

  • Devices: List and export device inventory with MDM information
  • Device Groups: Manage device groups and memberships
  • Analytics: Retrieve device analytics and metrics

Brew Package Management

  • Brewfiles: Full CRUD operations for Brewfile management
  • Brew Commands: Create and track brew command executions
  • Brew Configurations: View Homebrew configuration settings
  • Brew Taps: List available Homebrew taps
  • Formulae: Browse available Homebrew formulae
  • Casks: Browse available Homebrew casks

Security & Compliance

  • Vulnerabilities: Track package vulnerabilities across your fleet
  • Vulnerability Changes: Monitor vulnerability status changes over time
  • Events: Audit log for all system and user activities
  • Licenses: View and manage software licenses

HTTP Client Configuration

The SDK includes a powerful HTTP client with production-ready configuration options:

Configuration Options

The SDK client supports extensive configuration through functional options. Below is the complete list of available configuration options grouped by category.

Basic Configuration

client.WithAPIVersion("v0")              // Set API version
client.WithBaseURL("https://...")        // Custom base URL
client.WithTimeout(30*time.Second)       // Request timeout
client.WithRetryCount(3)                 // Number of retry attempts

TLS/Security

client.WithMinTLSVersion(tls.VersionTLS12)                    // Minimum TLS version
client.WithTLSClientConfig(tlsConfig)                         // Custom TLS configuration
client.WithRootCertificates("/path/to/ca.pem")                // Custom CA certificates
client.WithRootCertificateFromString(caPEM)                   // CA certificate from string
client.WithClientCertificate("/path/cert.pem", "/path/key.pem") // Client certificate (mTLS)
client.WithClientCertificateFromString(certPEM, keyPEM)       // Client cert from string
client.WithInsecureSkipVerify()                               // Skip cert verification (dev only!)

Network

client.WithProxy("http://proxy:8080")    // HTTP/HTTPS/SOCKS5 proxy
client.WithTransport(customTransport)    // Custom HTTP transport

Headers

client.WithUserAgent("MyApp/1.0")                      // Set User-Agent header
client.WithCustomAgent("MyApp")                        // Custom agent identifier
client.WithGlobalHeader("X-Custom-Header", "value")    // Add single global header
client.WithGlobalHeaders(map[string]string{...})       // Add multiple global headers

Observability

client.WithLogger(zapLogger)            // Structured logging with zap
client.WithTracing(otelConfig)          // OpenTelemetry distributed tracing
client.WithDebug()                      // Enable debug mode (dev only!)

Example: Production Configuration

import (
    "crypto/tls"
    "time"
    "go.uber.org/zap"
    "github.com/deploymenttheory/go-api-sdk-workbrew/workbrew/client"
)

logger, _ := zap.NewProduction()

apiClient, err := client.NewClient(
    "your-api-key",
    "your-workspace",
    client.WithTimeout(30*time.Second),
    client.WithRetryCount(3),
    client.WithLogger(logger),
    client.WithMinTLSVersion(tls.VersionTLS12),
    client.WithGlobalHeader("X-Application-Name", "MyDeviceManager"),
)

See the configuration guides for detailed documentation on each option.

Documentation

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Disclaimer

This is an unofficial SDK and is not affiliated with or endorsed by Workbrew.

About

Go sdk for the management of workbrew

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages