Documentation
¶
Overview ¶
Package customerapi provides an authenticated HTTP client for the XenForo Customer API.
Index ¶
- type Client
- func (c *Client) GetAccessToken() (string, error)
- func (c *Client) GetDownloadInfo(ctx context.Context, licenseKey string, downloadID string, versionID int) (*DownloadInfo, error)
- func (c *Client) GetDownloadURL(licenseKey string, downloadID string, versionID int) string
- func (c *Client) GetLicenseDownloadables(ctx context.Context, licenseKey string) (*LicenseDownloadables, error)
- func (c *Client) GetLicenseVersions(ctx context.Context, licenseKey string, downloadID string) (*LicenseVersions, error)
- func (c *Client) GetLicenses(ctx context.Context) ([]License, error)
- type DownloadInfo
- type License
- type LicenseDownloadables
- type LicenseExtra
- type LicenseVersions
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authenticated HTTP client for the XenForo Customer API. Concurrent refreshes are serialized within a client, and a refresh is skipped if another request has already replaced the stale token.
func (*Client) GetAccessToken ¶
GetAccessToken retrieves the current access token.
func (*Client) GetDownloadInfo ¶
func (c *Client) GetDownloadInfo(ctx context.Context, licenseKey string, downloadID string, versionID int) (*DownloadInfo, error)
GetDownloadInfo retrieves download information for a specific version.
func (*Client) GetDownloadURL ¶
GetDownloadURL returns the URL to download a specific version.
func (*Client) GetLicenseDownloadables ¶
func (c *Client) GetLicenseDownloadables(ctx context.Context, licenseKey string) (*LicenseDownloadables, error)
GetLicenseDownloadables retrieves the downloadable products for a license.
func (*Client) GetLicenseVersions ¶
func (c *Client) GetLicenseVersions(ctx context.Context, licenseKey string, downloadID string) (*LicenseVersions, error)
GetLicenseVersions retrieves the available versions for a product.
type DownloadInfo ¶
type DownloadInfo struct {
VersionString string `json:"version_string"`
Filename string `json:"filename"`
}
DownloadInfo represents information about a downloadable file.
type License ¶
type License struct {
LicenseKey string `json:"license_key"`
ProductID string `json:"product_id"`
ProductTitle string `json:"product_title"`
IsValid bool `json:"is_valid"`
IsActive bool `json:"is_active"`
StartDate unixTime `json:"start_date"`
ExpirationDate unixTime `json:"expiration_date"`
SiteURL string `json:"site_url,omitempty"`
SiteTitle string `json:"site_title,omitempty"`
CanDownload bool `json:"can_download"`
Extras []LicenseExtra `json:"extras,omitempty"`
}
License represents a XenForo customer license.
type LicenseDownloadables ¶
type LicenseDownloadables struct {
Downloadables []downloadable `json:"downloadables"`
}
LicenseDownloadables represents the downloadables available for a license.
type LicenseExtra ¶
type LicenseExtra struct {
ExtraID string `json:"extra_id"`
Name string `json:"name"`
IsDownloadable bool `json:"is_downloadable"`
}
LicenseExtra represents an extra (add-on product) associated with a license.
type LicenseVersions ¶
type LicenseVersions struct {
Versions []Version `json:"versions"`
}
LicenseVersions represents the versions available for a license/download.