apple_update_cdn

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppleUpdateCDNAPIClient

type AppleUpdateCDNAPIClient struct {
	Firmware *firmware.FirmwareService
	GDMF     *gdmf.GDMFService
	CDN      *cdn.CDNService
}

AppleUpdateCDNAPIClient groups all Apple Update CDN services.

type Client

type Client struct {
	AppleUpdateCDNAPI *AppleUpdateCDNAPIClient
	// contains filtered or unexported fields
}

Client is the main entry point for the Apple Update CDN SDK. It provides access to three services:

  • Firmware: discovers macOS IPSW restore firmware via the ipsw.me API
  • GDMF: queries Apple's official signed-version feed (gdmf.apple.com)
  • CDN: parses Apple CDN URLs and resolves file metadata via HEAD requests

func NewClient

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

NewClient creates a new Apple Update CDN client with optional configuration.

Example:

c, err := apple_update_cdn.NewClient(
    apple_update_cdn.WithTimeout(15 * time.Second),
    apple_update_cdn.WithLogger(logger),
)

func NewDefaultClient

func NewDefaultClient() (*Client, error)

NewDefaultClient creates a new Apple Update CDN client with default settings (30s timeout, 3 retries, no logging).

func (*Client) Close

func (c *Client) Close() error

Close releases resources held by the client.

type ClientOption

type ClientOption = client.ClientOption

ClientOption configures the Apple Update CDN transport at construction time. Pass one or more ClientOption values to NewClient or NewDefaultClient.

func WithClientCertificate

func WithClientCertificate(certFile, keyFile string) ClientOption

WithClientCertificate sets a client certificate for mutual TLS authentication.

func WithCustomAgent

func WithCustomAgent(customAgent string) ClientOption

WithCustomAgent appends a custom identifier to the default user agent.

func WithDebug

func WithDebug() ClientOption

WithDebug enables resty's request/response debug logging.

func WithGlobalHeader

func WithGlobalHeader(key, value string) ClientOption

WithGlobalHeader adds a single header to every outgoing request.

func WithGlobalHeaders

func WithGlobalHeaders(headers map[string]string) ClientOption

WithGlobalHeaders adds multiple headers to every outgoing request.

func WithInsecureSkipVerify

func WithInsecureSkipVerify() ClientOption

WithInsecureSkipVerify disables TLS certificate verification (use only for testing).

func WithLogger

func WithLogger(logger *zap.Logger) ClientOption

WithLogger sets a custom zap logger. Returns an error if logger is nil.

func WithMinTLSVersion

func WithMinTLSVersion(minVersion uint16) ClientOption

WithMinTLSVersion sets the minimum TLS version for connections.

func WithProxy

func WithProxy(proxyURL string) ClientOption

WithProxy sets an HTTP proxy for all requests.

func WithRetryCount

func WithRetryCount(count int) ClientOption

WithRetryCount sets the maximum number of retries for failed requests.

func WithRetryMaxWaitTime

func WithRetryMaxWaitTime(maxWaitTime time.Duration) ClientOption

WithRetryMaxWaitTime sets the maximum wait time between retry attempts.

func WithRetryWaitTime

func WithRetryWaitTime(waitTime time.Duration) ClientOption

WithRetryWaitTime sets the initial wait time between retry attempts.

func WithRootCertificates

func WithRootCertificates(pemFilePaths ...string) ClientOption

WithRootCertificates adds custom root CA certificates for server validation.

func WithTLSClientConfig

func WithTLSClientConfig(tlsConfig *tls.Config) ClientOption

WithTLSClientConfig sets custom TLS configuration.

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the timeout for all HTTP requests.

func WithTransport

func WithTransport(transport http.RoundTripper) ClientOption

WithTransport sets a custom HTTP transport (http.RoundTripper).

func WithUserAgent

func WithUserAgent(userAgent string) ClientOption

WithUserAgent sets a custom user-agent string.

Directories

Path Synopsis
apple_update_cdn_api
cdn
tools
download_progress
Package download_progress provides a terminal progress bar for streaming file downloads.
Package download_progress provides a terminal progress bar for streaming file downloads.

Jump to

Keyboard shortcuts

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