microsoft_updates

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: 14 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 {
	MicrosoftUpdatesAPI *MicrosoftUpdatesAPIClient
	// contains filtered or unexported fields
}

Client is the main entry point for the Microsoft Updates SDK. It provides access to nine services spanning official Microsoft endpoints and the Apple App Store:

  • Standalone: macOS standalone apps from the production Office CDN channel
  • StandaloneBeta: beta (Insider Fast) channel builds
  • StandalonePreview: preview (Insider Slow) channel builds
  • Edge: Microsoft Edge across all four channels (stable/beta/dev/canary)
  • OneDrive: OneDrive across all distribution rings
  • AppStoreMacOS: Microsoft apps in the macOS App Store via iTunes Search API
  • AppStoreIOS: Microsoft apps in the iOS App Store via iTunes Search API
  • UpdateHistory: Office for Mac update history (HTML scrape)
  • CVEHistory: Office for Mac CVE/security release notes (HTML scrape)

func NewClient

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

NewClient creates a new Microsoft Updates client with optional configuration.

Example:

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

func NewDefaultClient

func NewDefaultClient() (*Client, error)

NewDefaultClient creates a new Microsoft Updates 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 Microsoft Updates 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.

type MicrosoftUpdatesAPIClient

MicrosoftUpdatesAPIClient groups all Microsoft Updates sub-services.

Jump to

Keyboard shortcuts

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