license

package
v2.7.0-test.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterIDZero = "00000000-0000-0000-0000-000000000000"

Functions

func WithBundle

func WithBundle(ctx context.Context, licenseDir string) context.Context

Types

type Bundle

type Bundle struct {
	// contains filtered or unexported fields
}

func BundleFromContext

func BundleFromContext(ctx context.Context) *Bundle

func LoadBundle

func LoadBundle(rootDir string) (*Bundle, error)

func (*Bundle) GetLicenseClaims

func (l *Bundle) GetLicenseClaims() (*LicenseClaims, error)

func (*Bundle) GetLicenseInfo

func (l *Bundle) GetLicenseInfo(clusterID string, canConnectCloud bool, systemaURL string) *Info

func (*Bundle) Host

func (b *Bundle) Host() string

func (*Bundle) License

func (b *Bundle) License() string

type Info

type Info struct {
	ValidLicense bool
	LicenseErr   error
	Claims       *LicenseClaims

	CanConnectCloud bool
	SystemaURL      string
}

type LicenseClaims

type LicenseClaims struct {
	jwt.Claims
	AccountID string `json:"accountId"`
	Limits    any    `json:"limits"`
	Scope     string `json:"scope"`
}

func (*LicenseClaims) GetClusterID

func (lc *LicenseClaims) GetClusterID() (string, error)

func (*LicenseClaims) IsValidForCluster

func (lc *LicenseClaims) IsValidForCluster(cid string) error

Jump to

Keyboard shortcuts

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