Documentation
¶
Index ¶
- Variables
- type AuthRequest
- type CloudPod
- type CloudPodDetails
- type CloudPodResource
- type CloudPodResourceCount
- type CredentialsInfo
- type LicenseError
- type LicenseRequest
- type LicenseResponse
- type MachineInfo
- type PlatformAPI
- type PlatformClient
- func (c *PlatformClient) CheckAuthRequestConfirmed(ctx context.Context, id, exchangeToken string) (bool, error)
- func (c *PlatformClient) CreateAuthRequest(ctx context.Context) (*AuthRequest, error)
- func (c *PlatformClient) ExchangeAuthRequest(ctx context.Context, id, exchangeToken string) (string, error)
- func (c *PlatformClient) GetCloudPod(ctx context.Context, authToken, podName string) (*CloudPodDetails, error)
- func (c *PlatformClient) GetLicense(ctx context.Context, licReq *LicenseRequest) (*LicenseResponse, error)
- func (c *PlatformClient) GetLicenseToken(ctx context.Context, bearerToken string) (string, error)
- func (c *PlatformClient) ListCloudPods(ctx context.Context, authToken, creator string) ([]CloudPod, error)
- type ProductInfo
Constants ¶
This section is empty.
Variables ¶
var ErrCloudPodNotFound = errors.New("cloud pod not found")
ErrCloudPodNotFound is returned by GetCloudPod when the platform reports the requested pod does not exist (HTTP 404).
Functions ¶
This section is empty.
Types ¶
type AuthRequest ¶
type CloudPodDetails ¶ added in v0.13.0
type CloudPodDetails struct {
Name string
Version int
Created *time.Time
Size int64
LocalStackVersion string
Message string
Services []string
Resources []CloudPodResource
}
CloudPodDetails is the metadata for a single cloud snapshot, taken from its latest version. Resources is empty when the platform has no resource breakdown for the snapshot (e.g. it was saved without resource indexing enabled).
type CloudPodResource ¶ added in v0.13.0
type CloudPodResource struct {
Service string
Counts []CloudPodResourceCount
}
CloudPodResource groups the resource counts of a single service.
type CloudPodResourceCount ¶ added in v0.13.0
CloudPodResourceCount is a count of a single resource kind within a service, e.g. {Noun: "buckets", Count: 3}.
type CredentialsInfo ¶
type CredentialsInfo struct {
Token string `json:"token"`
}
type LicenseError ¶ added in v0.5.0
LicenseError is returned when license validation fails. Message is user-friendly; Detail contains the raw server response for debugging. IsUnsupportedTag is set when the server rejects the image tag format (a 400 whose detail carries the licensing.license.format error code). It means "the server cannot judge this tag", not that the license was rejected — the start pre-flight skips validation entirely on it and defers to the container's own license check, so keep the detection narrow: widening it widens that bypass.
func (*LicenseError) Error ¶ added in v0.5.0
func (e *LicenseError) Error() string
type LicenseRequest ¶
type LicenseRequest struct {
Product ProductInfo `json:"product"`
Credentials CredentialsInfo `json:"credentials"`
Machine MachineInfo `json:"machine"`
}
type LicenseResponse ¶ added in v0.5.7
type LicenseResponse struct {
LicenseType string `json:"license_type"`
RawBytes json.RawMessage `json:"-"`
}
func (*LicenseResponse) PlanDisplayName ¶ added in v0.5.7
func (r *LicenseResponse) PlanDisplayName() string
PlanDisplayName returns a human-readable plan name for the license type. Returns an empty string for a nil receiver or unknown types.
type MachineInfo ¶
type PlatformAPI ¶
type PlatformAPI interface {
CreateAuthRequest(ctx context.Context) (*AuthRequest, error)
CheckAuthRequestConfirmed(ctx context.Context, id, exchangeToken string) (bool, error)
ExchangeAuthRequest(ctx context.Context, id, exchangeToken string) (string, error)
GetLicenseToken(ctx context.Context, bearerToken string) (string, error)
GetLicense(ctx context.Context, req *LicenseRequest) (*LicenseResponse, error)
}
type PlatformClient ¶
type PlatformClient struct {
// contains filtered or unexported fields
}
func NewPlatformClient ¶
func NewPlatformClient(apiEndpoint string, logger log.Logger) *PlatformClient
func (*PlatformClient) CheckAuthRequestConfirmed ¶
func (*PlatformClient) CreateAuthRequest ¶
func (c *PlatformClient) CreateAuthRequest(ctx context.Context) (*AuthRequest, error)
func (*PlatformClient) ExchangeAuthRequest ¶
func (*PlatformClient) GetCloudPod ¶ added in v0.13.0
func (c *PlatformClient) GetCloudPod(ctx context.Context, authToken, podName string) (*CloudPodDetails, error)
GetCloudPod fetches metadata for a single cloud snapshot from the platform. It returns ErrCloudPodNotFound when the pod does not exist.
func (*PlatformClient) GetLicense ¶
func (c *PlatformClient) GetLicense(ctx context.Context, licReq *LicenseRequest) (*LicenseResponse, error)