api

package
v3.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadToFile

func DownloadToFile(ctx context.Context, downloadURL string, path string) error

Types

type AuthorizeDownloadRequest

type AuthorizeDownloadRequest struct {
	ArtifactID         string `json:"artifact_id"`
	ExpectedManifestID string `json:"expected_manifest_id"`
	DeviceFingerprint  string `json:"device_fingerprint"`
}

type AuthorizeDownloadResponse

type AuthorizeDownloadResponse struct {
	DownloadURL   string `json:"download_url"`
	ContentKeyB64 string `json:"content_key_b64"`
}

type Client

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

func NewClient

func NewClient(base string, opts ClientOptions) *Client

func (*Client) AuthorizeDownload

func (c *Client) AuthorizeDownload(ctx context.Context, accessToken string, req AuthorizeDownloadRequest) (AuthorizeDownloadResponse, error)

func (*Client) GetManifest

func (c *Client) GetManifest(ctx context.Context, accessToken string, req ManifestRequest) (ManifestResponse, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context, req LoginRequest) (LoginResponse, error)

func (*Client) Refresh

func (c *Client) Refresh(ctx context.Context, req RefreshRequest) (RefreshResponse, error)

type ClientOptions

type ClientOptions struct {
	Timeout time.Duration
	Proxy   string
}

type LoginRequest

type LoginRequest struct {
	LicenseKey        string `json:"license_key"`
	DeviceFingerprint string `json:"device_fingerprint"`
	ClientVersion     string `json:"client_version"`
	OS                string `json:"os"`
}

type LoginResponse

type LoginResponse struct {
	AccountID           string `json:"account_id"`
	DeviceID            string `json:"device_id"`
	AccessToken         string `json:"access_token"`
	RefreshToken        string `json:"refresh_token"`
	AccessExpiresInSec  int64  `json:"access_expires_in_sec"`
	RefreshExpiresInSec int64  `json:"refresh_expires_in_sec"`
}

type ManifestRequest

type ManifestRequest struct {
	Channel      string `json:"channel"`
	OSArch       string `json:"os_arch"`
	AfrogVersion string `json:"afrog_version"`
}

type ManifestResponse

type ManifestResponse struct {
	ManifestJSONB64 string `json:"manifest_json_b64"`
	ManifestSigB64  string `json:"manifest_sig_b64"`
}

type RefreshRequest

type RefreshRequest struct {
	RefreshToken      string `json:"refresh_token"`
	DeviceFingerprint string `json:"device_fingerprint"`
}

type RefreshResponse

type RefreshResponse struct {
	AccessToken         string `json:"access_token"`
	RefreshToken        string `json:"refresh_token"`
	AccessExpiresInSec  int64  `json:"access_expires_in_sec"`
	RefreshExpiresInSec int64  `json:"refresh_expires_in_sec"`
}

Jump to

Keyboard shortcuts

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