itunes

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 6 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 {
	ItunesAPI *ItunesAPIClient
	// contains filtered or unexported fields
}

Client is the main entry point for the iTunes Search API SDK.

func NewClient

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

NewClient creates a new iTunes Search API client with optional configuration.

Example:

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

func NewDefaultClient

func NewDefaultClient() (*Client, error)

NewDefaultClient creates a new iTunes Search API 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 added in v0.3.1

type ClientOption = client.ClientOption

ClientOption configures the iTunes Search API transport at construction time. Pass one or more ClientOption values to NewClient or NewDefaultClient.

func WithBaseURL added in v0.3.1

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets a custom base URL, overriding the default iTunes endpoint.

func WithClientCertificate added in v0.3.1

func WithClientCertificate(certFile, keyFile string) ClientOption

WithClientCertificate sets a client certificate for mutual TLS authentication.

func WithCustomAgent added in v0.3.1

func WithCustomAgent(customAgent string) ClientOption

WithCustomAgent appends a custom identifier to the default user agent.

func WithDebug added in v0.3.1

func WithDebug() ClientOption

WithDebug enables resty's request/response debug logging.

func WithGlobalHeader added in v0.3.1

func WithGlobalHeader(key, value string) ClientOption

WithGlobalHeader adds a single header to every outgoing request.

func WithGlobalHeaders added in v0.3.1

func WithGlobalHeaders(headers map[string]string) ClientOption

WithGlobalHeaders adds multiple headers to every outgoing request.

func WithInsecureSkipVerify added in v0.3.1

func WithInsecureSkipVerify() ClientOption

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

func WithLogger added in v0.3.1

func WithLogger(logger *zap.Logger) ClientOption

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

func WithMinTLSVersion added in v0.3.1

func WithMinTLSVersion(minVersion uint16) ClientOption

WithMinTLSVersion sets the minimum TLS version for connections.

func WithProxy added in v0.3.1

func WithProxy(proxyURL string) ClientOption

WithProxy sets an HTTP proxy for all requests.

func WithRetryCount added in v0.3.1

func WithRetryCount(count int) ClientOption

WithRetryCount sets the maximum number of retries for failed requests.

func WithRetryMaxWaitTime added in v0.3.1

func WithRetryMaxWaitTime(maxWaitTime time.Duration) ClientOption

WithRetryMaxWaitTime sets the maximum wait time between retry attempts.

func WithRetryWaitTime added in v0.3.1

func WithRetryWaitTime(waitTime time.Duration) ClientOption

WithRetryWaitTime sets the initial wait time between retry attempts.

func WithRootCertificates added in v0.3.1

func WithRootCertificates(pemFilePaths ...string) ClientOption

WithRootCertificates adds custom root CA certificates for server validation.

func WithTLSClientConfig added in v0.3.1

func WithTLSClientConfig(tlsConfig *tls.Config) ClientOption

WithTLSClientConfig sets custom TLS configuration.

func WithTimeout added in v0.3.1

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the timeout for all HTTP requests.

func WithTransport added in v0.3.1

func WithTransport(transport http.RoundTripper) ClientOption

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

func WithUserAgent added in v0.3.1

func WithUserAgent(userAgent string) ClientOption

WithUserAgent sets a custom user-agent string.

type ItunesAPIClient added in v0.3.1

type ItunesAPIClient struct {
	Search *search.SearchService
}

ItunesAPIClient groups all iTunes API services.

Directories

Path Synopsis
itunes_api

Jump to

Keyboard shortcuts

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