licensemock

package
v0.0.0-...-8fd811e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxUsers   = 50
	MaxClients = 2000
)

Variables

View Source
var HasValidLicense bool

Functions

This section is empty.

Types

type Capability

type Capability struct {
	Provider *MockCapabilityProvider

	Config *licensecap.Config
	Logger *logger.Logger
}

func (*Capability) GetConfigValidator

func (cap *Capability) GetConfigValidator() (v validator.Validator)

GetConfigValidator returns a validator interface that can be called to validate the capability config

func (*Capability) GetInitFuncName

func (cap *Capability) GetInitFuncName() (name string)

GetInitFuncName return the empty string as the mock capability doesn't use the plugin

func (*Capability) GetLicenseCapabilityEx

func (cap *Capability) GetLicenseCapabilityEx() (capEx licensecap.CapabilityEx)

GetLicenseCapabilityEx returns the mock provider's interface to the capability functions

func (*Capability) InitProvider

func (cap *Capability) InitProvider(initFn plugin.Symbol)

InitProvider sets the capability provider to the local mock implementation

type MockCapabilityProvider

type MockCapabilityProvider struct {
}

func (*MockCapabilityProvider) GetLicenseInfo

func (mp *MockCapabilityProvider) GetLicenseInfo() (licenseInfo *licensecap.PlusLicenseInfo)

GetLicenseInfo makes the retrieved license info available to rportd

func (*MockCapabilityProvider) GetMaxClients

func (mp *MockCapabilityProvider) GetMaxClients() (maxClients int)

GetMaxClients returns the max clients allowed by the license

func (*MockCapabilityProvider) GetMaxUsers

func (mp *MockCapabilityProvider) GetMaxUsers() (maxUsers int)

GetMaxUsers returns the max users allowed by the license

func (*MockCapabilityProvider) IsTrialMode

func (mp *MockCapabilityProvider) IsTrialMode() (isTrial bool)

Gets the current trial mode status for rportd

func (*MockCapabilityProvider) LicenseInfoAvailable

func (mp *MockCapabilityProvider) LicenseInfoAvailable() (avail bool)

LicenseInfoAvailable returns true if the license info has been received from the license server

func (*MockCapabilityProvider) SetLicenseInfoAvailableNotifier

func (mp *MockCapabilityProvider) SetLicenseInfoAvailableNotifier(notifyFn licensecap.LicenseInfoAvailableNotifier)

SetLicenseInfoAvailableNotifier informs the runner of the notify fn to handle when the license info has been received

func (*MockCapabilityProvider) ValidateConfig

func (mp *MockCapabilityProvider) ValidateConfig() (err error)

ValidateConfig does nothing for the mock implementation

Jump to

Keyboard shortcuts

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