licenseutils

package
v0.0.0-...-814ced4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyLicense

func ApplyLicense(ctx context.Context, dclient licensing.WrappedDockerClient, license *model.IssuedLicense) error

ApplyLicense will store a license on the local system

func GetLicenseSummary

func GetLicenseSummary(ctx context.Context, license model.IssuedLicense) (string, error)

GetLicenseSummary summarizes the license for the user

func LoadLocalIssuedLicense

func LoadLocalIssuedLicense(ctx context.Context, filename string) (*model.IssuedLicense, error)

LoadLocalIssuedLicense will load a local license file

Types

type HubUser

type HubUser struct {
	User model.User
	Orgs []model.Org
	// contains filtered or unexported fields
}

HubUser wraps a licensing client and holds key information for a user to avoid multiple lookups

func Login

func Login(ctx context.Context, authConfig *types.AuthConfig) (HubUser, error)

Login to the license server and return a client that can be used to look up and download license files or generate new trial licenses

func (HubUser) GenerateTrialLicense

func (u HubUser) GenerateTrialLicense(ctx context.Context, targetID string) (*model.IssuedLicense, error)

GenerateTrialLicense will generate a new trial license for the specified user or org

func (HubUser) GetAvailableLicenses

func (u HubUser) GetAvailableLicenses(ctx context.Context) ([]LicenseDisplay, error)

GetAvailableLicenses finds all available licenses for a given account and their orgs

func (HubUser) GetIssuedLicense

func (u HubUser) GetIssuedLicense(ctx context.Context, ID string) (*model.IssuedLicense, error)

GetIssuedLicense will download a license by ID

func (HubUser) GetOrgByID

func (u HubUser) GetOrgByID(orgID string) (model.Org, error)

GetOrgByID finds the org by the ID in the users list of orgs

type LicenseDisplay

type LicenseDisplay struct {
	model.Subscription
	Num              int
	Owner            string
	ComponentsString string
}

LicenseDisplay stores license details for display

Jump to

Keyboard shortcuts

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