Documentation ¶
Index ¶
- Constants
- Variables
- func DoesUserHasActiveTrialLicense() (out bool)
- func FetchAndPersist() []string
- func FetchLicenseKeys() (out []string)
- func FetchLicenseKeysBasedOnType(licenseType string) (out []string)
- func FetchLicenseType(licenseKeys []string) string
- func FetchLicenseTypeBasedOnKey(license_keys []string) string
- func GetLastUserInput() string
- func GlobalFetchAndPersist() []string
- func HasUnrestrictedLicenseAdded(newKeys []string, licenseType string) bool
- func IsLicenseRestricted(licenseType string) (out bool)
- func OnPremFetchAndPersist() []string
- func PrintLicenseKeyOverview(keys []string)
- func SetFileHandler(handler FileHandler)
- func SetLastUserInput(val string)
- func StartInteractions(startID string) (keys []string)
- func UpdatePromptInputs(conf map[string]string)
- func ValidateKeyFormat(key string) (matches bool)
- type ActionDetail
- func (ad ActionDetail) Ask() string
- func (ad ActionDetail) CheckLicenseExpirationStatus() string
- func (ad ActionDetail) DetermineRestrictionType() string
- func (ad ActionDetail) DisplayLicenseInfo() string
- func (ad ActionDetail) DoesLicenseHaveValidPattern() string
- func (ad ActionDetail) Error() string
- func (ad ActionDetail) FetchInvalidLicenseMessage() string
- func (ad ActionDetail) FetchLicenseId() string
- func (ad ActionDetail) FetchLicenseTypeRestricted() string
- func (ad ActionDetail) FilterLicenseTypeOptions() string
- func (ad ActionDetail) IsCommercialLicense() string
- func (ad ActionDetail) IsLicenseAllowed() string
- func (ad ActionDetail) IsLicenseValidOnServer() string
- func (ad ActionDetail) IsRunAllowedOnLicenseExhausted() string
- func (ad ActionDetail) Ok() string
- func (ad ActionDetail) PerformInteraction() (nextID string)
- func (ad ActionDetail) Say() string
- func (ad ActionDetail) SayAndSelect() string
- func (ad ActionDetail) Select() string
- func (ad ActionDetail) SetLicenseInfo() string
- func (ad ActionDetail) TimeoutSelect() string
- func (ad ActionDetail) Warn() string
- type FileHandler
- type Interaction
- type LicenseData
- type LicenseFileData
- type LicenseFileHandler
- type MockFileHandler
- type PromptAttribute
- type TemplateConfig
Constants ¶
View Source
const ( LICENSE_KEY_REGEX = `^([a-z]{4}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-[0-9]{1,4})$` LICENSE_KEY_PATTERN_DESC = "Hexadecimal" SERIAL_KEY_REGEX = `^([A-Z0-9]{26})$` SERIAL_KEY_PATTERN_DESC = "26 character alphanumeric string" COMMERCIAL_KEY_REGEX = `^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$` QUIT_KEY_REGEX = "(q|Q)" )
View Source
const (
FILE_VERSION = "4.0.0"
)
Variables ¶
View Source
var ErrInvalidKeyFormat = fmt.Errorf(fmt.Sprintf("Malformed License Key passed on command line - should be %s or %s", LICENSE_KEY_PATTERN_DESC, SERIAL_KEY_PATTERN_DESC))
View Source
var LICENSE_TYPES []string = []string{"free", "trial", "commercial"}
Functions ¶
func DoesUserHasActiveTrialLicense ¶
func DoesUserHasActiveTrialLicense() (out bool)
func FetchAndPersist ¶
func FetchAndPersist() []string
func FetchLicenseKeys ¶
func FetchLicenseKeys() (out []string)
func FetchLicenseType ¶
func GetLastUserInput ¶
func GetLastUserInput() string
func GlobalFetchAndPersist ¶
func GlobalFetchAndPersist() []string
func IsLicenseRestricted ¶
func OnPremFetchAndPersist ¶
func OnPremFetchAndPersist() []string
func PrintLicenseKeyOverview ¶
func PrintLicenseKeyOverview(keys []string)
func SetFileHandler ¶
func SetFileHandler(handler FileHandler)
func SetLastUserInput ¶
func SetLastUserInput(val string)
func StartInteractions ¶
func UpdatePromptInputs ¶
func ValidateKeyFormat ¶
Types ¶
type ActionDetail ¶
type ActionDetail struct { Messages []string `yaml:"messages"` Options []string `yaml:"options,omitempty"` Action string `yaml:"action"` PromptType string `yaml:"prompt_type"` PromptAttribute PromptAttribute `yaml:"prompt_attributes"` Paths []string `yaml:"paths"` ResponsePathMap map[string]string `yaml:"response_path_map"` Choice string `yaml:"choice"` }
func (ActionDetail) Ask ¶
func (ad ActionDetail) Ask() string
func (ActionDetail) CheckLicenseExpirationStatus ¶
func (ad ActionDetail) CheckLicenseExpirationStatus() string
func (ActionDetail) DetermineRestrictionType ¶
func (ad ActionDetail) DetermineRestrictionType() string
func (ActionDetail) DisplayLicenseInfo ¶
func (ad ActionDetail) DisplayLicenseInfo() string
func (ActionDetail) DoesLicenseHaveValidPattern ¶
func (ad ActionDetail) DoesLicenseHaveValidPattern() string
func (ActionDetail) Error ¶
func (ad ActionDetail) Error() string
func (ActionDetail) FetchInvalidLicenseMessage ¶
func (ad ActionDetail) FetchInvalidLicenseMessage() string
func (ActionDetail) FetchLicenseId ¶
func (ad ActionDetail) FetchLicenseId() string
func (ActionDetail) FetchLicenseTypeRestricted ¶
func (ad ActionDetail) FetchLicenseTypeRestricted() string
func (ActionDetail) FilterLicenseTypeOptions ¶
func (ad ActionDetail) FilterLicenseTypeOptions() string
func (ActionDetail) IsCommercialLicense ¶
func (ad ActionDetail) IsCommercialLicense() string
func (ActionDetail) IsLicenseAllowed ¶
func (ad ActionDetail) IsLicenseAllowed() string
func (ActionDetail) IsLicenseValidOnServer ¶
func (ad ActionDetail) IsLicenseValidOnServer() string
func (ActionDetail) IsRunAllowedOnLicenseExhausted ¶
func (ad ActionDetail) IsRunAllowedOnLicenseExhausted() string
func (ActionDetail) Ok ¶
func (ad ActionDetail) Ok() string
func (ActionDetail) PerformInteraction ¶
func (ad ActionDetail) PerformInteraction() (nextID string)
func (ActionDetail) Say ¶
func (ad ActionDetail) Say() string
func (ActionDetail) SayAndSelect ¶
func (ad ActionDetail) SayAndSelect() string
func (ActionDetail) Select ¶
func (ad ActionDetail) Select() string
func (ActionDetail) SetLicenseInfo ¶
func (ad ActionDetail) SetLicenseInfo() string
func (ActionDetail) TimeoutSelect ¶
func (ad ActionDetail) TimeoutSelect() string
func (ActionDetail) Warn ¶
func (ad ActionDetail) Warn() string
type FileHandler ¶
type FileHandler interface { CheckFilePresence(filename string) bool ReadFile(filename string) ([]byte, error) WriteFile(filename string, data []byte, perm os.FileMode) error }
func GetFileHandler ¶
func GetFileHandler() *FileHandler
type Interaction ¶
type Interaction struct { FileFormatVersion string `yaml:":file_format_version"` Actions map[string]ActionDetail `yaml:"interactions"` }
type LicenseData ¶
type LicenseFileData ¶
type LicenseFileData struct { Licenses []LicenseData `yaml:":licenses"` FileFormatVersion string `yaml:":file_format_version"` LicenseServerURL string `yaml:":license_server_url"` }
type LicenseFileHandler ¶
type LicenseFileHandler struct{}
func (LicenseFileHandler) CheckFilePresence ¶
func (LicenseFileHandler) CheckFilePresence(filename string) bool
type MockFileHandler ¶
func (MockFileHandler) CheckFilePresence ¶
func (m MockFileHandler) CheckFilePresence(filename string) bool
type PromptAttribute ¶
Click to show internal directories.
Click to hide internal directories.