keycodes

package
v4.2.279+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeycodeStatusUnknown      = 0
	KeycodeStatusNoKeycode    = 1
	KeycodeStatusInvalid      = 2
	KeycodeStatusExpired      = 3
	KeycodeStatusNotActivated = 4
	KeycodeStatusValid        = 5
)

Variables

View Source
var (
	KeycodeCliPath              = defaultCliPath
	KeycodeDuration  int64      = defaultRefreshInterval
	KeycodeStatus               = KeycodeStatusUnknown
	KeycodeAesKey               = []byte("")
	KeycodeTimestamp int64      = 0
	KeycodeList      []*Keycode = nil
	KeycodeSummary   *Keycode   = nil
	KeycodeTM        time.Time
	KeycodeMutex     sync.Mutex
	InfluxConfig     *InternalInflux.Config
	LdapConfig       *InternalLdap.Config
)
View Source
var KeycodeStatusMessage = map[int]string{
	0: "Unknown keycode is detected",
	1: "No keycode is applied",
	2: "Invalid keycode is detected",
	3: "Keycode is expired",
	4: "Keycode is not activated",
	5: "A valid keycode is applied",
}
View Source
var KeycodeStatusName = map[int]string{
	0: "Unknown",
	1: "No Keycode",
	2: "Invalid",
	3: "Expired",
	4: "Not Activated",
	5: "Valid",
}

Functions

func KeycodeInit

func KeycodeInit(config *Config) error

func NewKeycodeEvent

func NewKeycodeEvent(level DatahubV1alpha1.EventLevel, message string) *DatahubV1alpha1.Event

func PostEvent

func PostEvent(level DatahubV1alpha1.EventLevel, message string) error

Types

type AllKeycodesResult

type AllKeycodesResult struct {
	Result
	Data    []*Keycode `json:"data"`
	Summary *Keycode   `json:"summary"`
}

type Capacity

type Capacity struct {
	Users int `json:"users" example:"-1"`
	Hosts int `json:"hosts" example:"20"`
	Disks int `json:"disks" example:"200"`
}

type Config

type Config struct {
	CliPath         string
	RefreshInterval int64
	AesKey          []byte
	InfluxDB        *InternalInflux.Config
	Ldap            *InternalLdap.Config
}

Configuration of keycode CLI

func NewDefaultConfig

func NewDefaultConfig() *Config

Provide default configuration for keycode CLI

func (*Config) Validate

func (c *Config) Validate() error

Confirm the keycode CLI configuration is validated

type Functionality

type Functionality struct {
	Diskprophet bool `json:"diskprophet" example:"true"`
	Workload    bool `json:"workload"    example:"true"`
}

type Keycode

type Keycode struct {
	Keycode          string           `json:"keycode"          example:"A5IMH-KBAFI-XTEDK-G4OQM-QMM67-4TEST"`
	KeycodeType      string           `json:"keycodeType"      example:"Regular/Trial"`
	KeycodeVersion   int              `json:"keycodeVersion"   example:"2"`
	ApplyTimestamp   int64            `json:"applyTimestamp"   example:"1546271999"`
	ExpireTimestamp  int64            `json:"expireTimestamp"  example:"1546271999"`
	LicenseState     string           `json:"licenseState"     example:"Valid/Invalid/Expired"`
	Registered       bool             `json:"registered"       example:"false"`
	Capacity         Capacity         `json:"capacity"         example:"capacity"`
	Functionality    Functionality    `json:"functionality"    example:"functionality"`
	Retention        Retention        `json:"retention"        example:"retention"`
	ServiceAgreement ServiceAgreement `json:"serviceAgreement" example:"service agreement"`
	Description      string           `json:"description"      example:"your-description"`
}

func NewKeycode

func NewKeycode(keycode string) *Keycode

type KeycodeExecutor

type KeycodeExecutor struct {
	Cli      string
	LdapArgs []string
}

func NewKeycodeExecutor

func NewKeycodeExecutor() *KeycodeExecutor

func (*KeycodeExecutor) AddKeycode

func (c *KeycodeExecutor) AddKeycode(keycode string) error

func (*KeycodeExecutor) DeleteKeycode

func (c *KeycodeExecutor) DeleteKeycode(keycode string) error

func (*KeycodeExecutor) GetAllKeycodes

func (c *KeycodeExecutor) GetAllKeycodes() ([]*Keycode, *Keycode, error)

func (*KeycodeExecutor) GetKeycode

func (c *KeycodeExecutor) GetKeycode(keycode string) (*Keycode, error)

func (*KeycodeExecutor) GetKeycodeSummary

func (c *KeycodeExecutor) GetKeycodeSummary() (*Keycode, error)

func (*KeycodeExecutor) GetRegistrationData

func (c *KeycodeExecutor) GetRegistrationData() (string, error)

func (*KeycodeExecutor) PutSignatureData

func (c *KeycodeExecutor) PutSignatureData(signatureData string) error

func (*KeycodeExecutor) PutSignatureDataFile

func (c *KeycodeExecutor) PutSignatureDataFile(filePath string) error

type KeycodeMgt

type KeycodeMgt struct {
	Executor      *KeycodeExecutor
	Status        *KeycodeStatusObject
	KeycodeStatus int
}

func NewKeycodeMgt

func NewKeycodeMgt() *KeycodeMgt

func (*KeycodeMgt) AddKeycode

func (c *KeycodeMgt) AddKeycode(keycode string) error

func (*KeycodeMgt) DeleteKeycode

func (c *KeycodeMgt) DeleteKeycode(keycode string) error

func (*KeycodeMgt) GetAllKeycodes

func (c *KeycodeMgt) GetAllKeycodes() ([]*Keycode, *Keycode, error)

func (*KeycodeMgt) GetKeycode

func (c *KeycodeMgt) GetKeycode(keycode string) (*Keycode, error)

func (*KeycodeMgt) GetKeycodeSummary

func (c *KeycodeMgt) GetKeycodeSummary() (*Keycode, error)

func (*KeycodeMgt) GetKeycodes

func (c *KeycodeMgt) GetKeycodes(keycodes []string) ([]*Keycode, *Keycode, error)

func (*KeycodeMgt) GetRegistrationData

func (c *KeycodeMgt) GetRegistrationData() (string, error)

func (*KeycodeMgt) GetStatus

func (c *KeycodeMgt) GetStatus() int

NOTE: DO Refresh() before GetStatus() if necessary

func (*KeycodeMgt) IsExpired

func (c *KeycodeMgt) IsExpired() bool

func (*KeycodeMgt) IsValid

func (c *KeycodeMgt) IsValid() bool

func (*KeycodeMgt) PutSignatureData

func (c *KeycodeMgt) PutSignatureData(signatureData string) error

func (*KeycodeMgt) PutSignatureDataFile

func (c *KeycodeMgt) PutSignatureDataFile(filePath string) error

func (*KeycodeMgt) Refresh

func (c *KeycodeMgt) Refresh(force bool) error

type KeycodeResult

type KeycodeResult struct {
	Result
	Data *Keycode `json:"data"`
}

type KeycodeStatusObject

type KeycodeStatusObject struct {
}

func NewKeycodeStatusObject

func NewKeycodeStatusObject() *KeycodeStatusObject

func (*KeycodeStatusObject) GetStatus

func (c *KeycodeStatusObject) GetStatus() int

type RegistrationDataResult

type RegistrationDataResult struct {
	Result
	Data string `json:"data"`
}

type Result

type Result struct {
	Status int    `json:"status"`
	Reason string `json:"reason"`
}

type Retention

type Retention struct {
	ValidMonth int `json:"validMonth" example:"0"`
	Years      int `json:"years"      example:"1"`
}

type ServiceAgreement

type ServiceAgreement struct {
}

Jump to

Keyboard shortcuts

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