api

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package api provides the unified API client for Google Play APIs.

Index

Constants

View Source
const DefaultConcurrentCalls = 3

DefaultConcurrentCalls is the default number of concurrent API calls.

Variables

View Source
var ValidTracks = []string{"internal", "alpha", "beta", "production"}

Functions

func IsValidReleaseStatus

func IsValidReleaseStatus(status string) bool

IsValidReleaseStatus checks if a release status is valid.

func IsValidTrack

func IsValidTrack(track string) bool

IsValidTrack checks if a track name is valid.

func IsVerbose

func IsVerbose(ctx context.Context) bool

IsVerbose checks if verbose mode is enabled in the context.

func WithVerbose

func WithVerbose(ctx context.Context, verbose bool) context.Context

WithVerbose returns a context with verbose mode enabled.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, tokenSource oauth2.TokenSource, opts ...Option) (*Client, error)

func (*Client) Acquire

func (c *Client) Acquire(ctx context.Context) error

Acquire acquires a semaphore slot for concurrent API calls.

func (*Client) AcquireForUpload

func (c *Client) AcquireForUpload(ctx context.Context) error

AcquireForUpload acquires exclusive access for upload operations. Uploads are single-threaded for reliability.

func (*Client) AndroidPublisher

func (c *Client) AndroidPublisher() (*androidpublisher.Service, error)

AndroidPublisher returns the Android Publisher API service.

func (*Client) DoWithRetry

func (c *Client) DoWithRetry(ctx context.Context, fn func() error) error

func (*Client) Games

func (c *Client) Games() (*games.Service, error)

Games returns the Play Games Services API service.

func (*Client) GamesManagement

func (c *Client) GamesManagement() (*gamesmanagement.Service, error)

GamesManagement returns the Games Management API service.

func (*Client) PlayCustomApp

func (c *Client) PlayCustomApp() (*playcustomapp.Service, error)

PlayCustomApp returns the Play Custom App Publishing API service.

func (*Client) PlayIntegrity

func (c *Client) PlayIntegrity() (*playintegrity.Service, error)

PlayIntegrity returns the Play Integrity API service.

func (*Client) PlayReporting

func (c *Client) PlayReporting() (*playdeveloperreporting.Service, error)

PlayReporting returns the Play Developer Reporting API service.

func (*Client) Release

func (c *Client) Release()

Release releases a semaphore slot.

func (*Client) ReleaseForUpload

func (c *Client) ReleaseForUpload()

func (*Client) RetryConfig

func (c *Client) RetryConfig() RetryConfig

type Option

type Option func(*Client)

Option configures the API client.

func WithConcurrentCalls

func WithConcurrentCalls(n int) Option

func WithMaxRetryAttempts

func WithMaxRetryAttempts(n int) Option

func WithRetryConfig

func WithRetryConfig(cfg RetryConfig) Option

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the HTTP client timeout.

func WithVerboseLogging

func WithVerboseLogging(verbose bool) Option

WithVerboseLogging enables verbose logging for API requests.

type ReleaseConfig

type ReleaseConfig struct {
	Track        string
	Name         string
	Status       ReleaseStatus
	VersionCodes []int64
	UserFraction float64
	ReleaseNotes map[string]string // locale -> text
}

ReleaseConfig holds configuration for creating a release.

type ReleaseStatus

type ReleaseStatus string

ReleaseStatus represents the status of a release.

const (
	StatusDraft      ReleaseStatus = "draft"
	StatusCompleted  ReleaseStatus = "completed"
	StatusHalted     ReleaseStatus = "halted"
	StatusInProgress ReleaseStatus = "inProgress"
)

type RetryConfig

type RetryConfig struct {
	MaxAttempts  int
	InitialDelay time.Duration
	MaxDelay     time.Duration
}

RetryConfig holds configuration for request retries.

func DefaultRetryConfig

func DefaultRetryConfig() RetryConfig

type UploadOptions

type UploadOptions struct {
	ChunkSize    int64                      // Chunk size for resumable uploads
	ProgressFunc func(current, total int64) // Progress callback
}

UploadOptions holds options for artifact uploads.

func DefaultUploadOptions

func DefaultUploadOptions() *UploadOptions

DefaultUploadOptions returns the default upload options.

Jump to

Keyboard shortcuts

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