Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrWorkerNode returned on a swarm worker node - lookup licenses on swarm managers ErrWorkerNode = fmt.Errorf("this node is not a swarm manager - check license status on a manager node") // ErrUnlicensed returned when no license found ErrUnlicensed = fmt.Errorf("no license found") )
Functions ¶
func StoreLicense ¶
func StoreLicense(ctx context.Context, clnt WrappedDockerClient, license *model.IssuedLicense, rootDir string) error
StoreLicense will store the license on the host filesystem and swarm (if swarm is active)
Types ¶
type Client ¶
type Client interface {
LoginViaAuth(ctx context.Context, username, password string) (authToken string, err error)
GetHubUserOrgs(ctx context.Context, authToken string) (orgs []model.Org, err error)
GetHubUserByName(ctx context.Context, username string) (user *model.User, err error)
VerifyLicense(ctx context.Context, license model.IssuedLicense) (res *model.CheckResponse, err error)
GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error)
ListSubscriptions(ctx context.Context, authToken, dockerID string) (response []*model.Subscription, err error)
ListSubscriptionsDetails(ctx context.Context, authToken, dockerID string) (response []*model.SubscriptionDetail, err error)
DownloadLicenseFromHub(ctx context.Context, authToken, subscriptionID string) (license *model.IssuedLicense, err error)
ParseLicense(license []byte) (parsedLicense *model.IssuedLicense, err error)
StoreLicense(ctx context.Context, dclnt WrappedDockerClient, licenses *model.IssuedLicense, localRootDir string) error
LoadLocalLicense(ctx context.Context, dclnt WrappedDockerClient) (*model.Subscription, error)
SummarizeLicense(res *model.CheckResponse) *model.Subscription
}
Client represents the licensing package interface, including methods for authentication and interaction with Docker licensing, accounts, and billing services
type Config ¶
type Config struct {
BaseURI url.URL
HTTPClient *http.Client
// used by licensing client to validate an issued license
PublicKeys []string
}
Config holds licensing client configuration
type RequestParams ¶
RequestParams holds request parameters
type WrappedDockerClient ¶
type WrappedDockerClient interface {
Info(ctx context.Context) (types.Info, error)
NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error)
ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error)
ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error)
}
WrappedDockerClient provides methods useful for installing licenses to the wrapped docker engine or cluster
Directories
¶
| Path | Synopsis |
|---|---|
|
lib
|
|
|
errors
Package errors provides error and error wrapping facilities that allow for the easy reporting of call stacks and structured error annotations.
|
Package errors provides error and error wrapping facilities that allow for the easy reporting of call stacks and structured error annotations. |
Click to show internal directories.
Click to hide internal directories.