api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	ID            string `json:"id"`
	Code          string `json:"code"`
	ExchangeToken string `json:"exchange_token"`
}

type CredentialsInfo

type CredentialsInfo struct {
	Token string `json:"token"`
}

type LicenseError added in v0.5.0

type LicenseError struct {
	Status  int
	Message string
	Detail  string
}

LicenseError is returned when license validation fails. Message is user-friendly; Detail contains the raw server response for debugging.

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 MachineInfo

type MachineInfo struct {
	Hostname        string `json:"hostname,omitempty"`
	Platform        string `json:"platform,omitempty"`
	PlatformRelease string `json:"platform_release,omitempty"`
}

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) 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 (c *PlatformClient) CheckAuthRequestConfirmed(ctx context.Context, id, exchangeToken string) (bool, error)

func (*PlatformClient) CreateAuthRequest

func (c *PlatformClient) CreateAuthRequest(ctx context.Context) (*AuthRequest, error)

func (*PlatformClient) ExchangeAuthRequest

func (c *PlatformClient) ExchangeAuthRequest(ctx context.Context, id, exchangeToken string) (string, error)

func (*PlatformClient) GetLicense

func (c *PlatformClient) GetLicense(ctx context.Context, licReq *LicenseRequest) error

func (*PlatformClient) GetLicenseToken

func (c *PlatformClient) GetLicenseToken(ctx context.Context, bearerToken string) (string, error)

type ProductInfo

type ProductInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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