license

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package to handle the licensing status of a client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNilSubscriptionType

func NewNilSubscriptionType() *nilSubscriptionType

Types

type ConfigManager

type ConfigManager interface {
	// GetConfig returns the current config, i.e., the ecrpyted key/passphrase pair.
	GetConfig() *stnrv1.LicenseConfig
	// Reconcile updates the the licensing status, i.e., the licensed feature-set and the
	// subscription type, based in an ecrpyted key/passphrase pair.
	Reconcile(config *stnrv1.LicenseConfig)
	// Validate checks whether a client is entitled to use a feature.
	Validate(feature Feature) bool
	// SubscriptionType returns the current subscription type (e.g., free, member, enterprise).
	SubscriptionType() SubscriptionType
	// Status returns the current licensing status.
	Status() string
}

Manager is a genetic API for negotiating licensing status.

func New

New creares a new license config manager.

func NewStub

func NewStub(log logging.LeveledLogger) ConfigManager

type Feature

type Feature interface {
	fmt.Stringer
}

Feature defines the supported features.

type Stub

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

Stub is the default license manager that implements the free/open-source tier.

func (*Stub) GetConfig

func (m *Stub) GetConfig() *stnrv1.LicenseConfig

func (*Stub) Reconcile

func (s *Stub) Reconcile(config *stnrv1.LicenseConfig)

func (*Stub) Status

func (m *Stub) Status() string

func (*Stub) SubscriptionType

func (m *Stub) SubscriptionType() SubscriptionType

func (*Stub) Validate

func (m *Stub) Validate(_ Feature) bool

type SubscriptionType

type SubscriptionType interface {
	fmt.Stringer
}

SubscriptionType is the current subscription type.

Jump to

Keyboard shortcuts

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