Documentation
¶
Index ¶
- type Client
- type ClientOption
- func WithClientCertificate(certFile, keyFile string) ClientOption
- func WithCustomAgent(customAgent string) ClientOption
- func WithDebug() ClientOption
- func WithGlobalHeader(key, value string) ClientOption
- func WithGlobalHeaders(headers map[string]string) ClientOption
- func WithInsecureSkipVerify() ClientOption
- func WithLogger(logger *zap.Logger) ClientOption
- func WithMinTLSVersion(minVersion uint16) ClientOption
- func WithProxy(proxyURL string) ClientOption
- func WithRetryCount(count int) ClientOption
- func WithRetryMaxWaitTime(maxWaitTime time.Duration) ClientOption
- func WithRetryWaitTime(waitTime time.Duration) ClientOption
- func WithRootCertificates(pemFilePaths ...string) ClientOption
- func WithTLSClientConfig(tlsConfig *tls.Config) ClientOption
- func WithTimeout(timeout time.Duration) ClientOption
- func WithTransport(transport http.RoundTripper) ClientOption
- func WithUserAgent(userAgent string) ClientOption
- type MicrosoftUpdatesAPIClient
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 ¶
NewDefaultClient creates a new Microsoft Updates client with default settings (30s timeout, 3 retries, no logging).
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 ¶
type MicrosoftUpdatesAPIClient struct {
Standalone *standalone.StandaloneService
StandaloneBeta *standalone_beta.StandaloneBetaService
StandalonePreview *standalone_preview.StandalonePreviewService
Edge *edge.EdgeService
OneDrive *onedrive.OneDriveService
AppStoreMacOS *appstore_macos.AppStoreMacOSService
AppStoreIOS *appstore_ios.AppStoreIOSService
UpdateHistory *update_history.UpdateHistoryService
CVEHistory *cve_history.CVEHistoryService
}
MicrosoftUpdatesAPIClient groups all Microsoft Updates sub-services.