license

package
v0.0.1-dev-a64490c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Module = "licenses"
	Dir    = "/etc/update"

	CubeCOS = "CubeCOS"
	CubeCMP = "CubeCMP"
)

Variables

This section is empty.

Functions

func LowerProductsInPlace

func LowerProductsInPlace(products []string)

func SetList

func SetList(licenses []Options)

Types

type Attachment

type Attachment struct {
	SerialNumber string `json:"serialNumber"`
	Hostname     string `json:"hostname"`
	Role         string `json:"role"`
	Product      string `json:"product"`
	Status       string `json:"status"`
}

func (*Attachment) GenSearchableObject

func (o *Attachment) GenSearchableObject() Attachment

type Expiry

type Expiry struct {
	Date string `json:"date" yaml:"date" bson:"date"`
	Days int    `json:"days" yaml:"days" bson:"days"`
}

type Issue

type Issue struct {
	By       string `json:"by" yaml:"by" bson:"by"`
	To       string `json:"to" yaml:"to" bson:"to"`
	Hardware string `json:"hardware" yaml:"hardware" bson:"hardware"`
	Date     string `json:"date" yaml:"date" bson:"date"`
}

type Node

type Node struct {
	Name   string `json:"name" yaml:"name" bson:"name"`
	Role   string `json:"role" yaml:"role" bson:"role"`
	Expiry `json:"expiry" yaml:"expiry" bson:"expiry"`
	Status status.License `json:"status" yaml:"status" bson:"status"`
}

type Options

type Options struct {
	Name        string   `json:"name" yaml:"name" bson:"name"`
	Type        string   `json:"type" yaml:"type" bson:"type"`
	Hostname    string   `json:"hostname,omitzero" yaml:"hostname" bson:"hostname"`
	Hosts       []string `json:"hosts,omitempty" yaml:"hosts" bson:"hosts"`
	Serial      string   `json:"serial,omitzero" yaml:"serial" bson:"serial"`
	Product     `json:"product" yaml:"product" bson:"product"`
	Issue       `json:"issue" yaml:"issue" bson:"issue"`
	Quantity    string `json:"quantity" yaml:"quantity" bson:"quantity"`
	SupportPlan string `json:"supportPlan" yaml:"supportPlan" bson:"supportPlan"`
	Expiry      `json:"expiry" yaml:"expiry" bson:"expiry"`
	Status      status.License `json:"status" yaml:"status" bson:"status"`
}

func List

func List() []Options

func (*Options) GenSearchableObject

func (o *Options) GenSearchableObject() Options

note: in the current search lib(bleve), the algo is not able to detect the string if it include uppercase we've tried a few different init settings, but the result is not as expected as always currenlty, the only way we found is to convert all the string to lower case and inject to searcher

func (*Options) InitCompromisedStatus

func (o *Options) InitCompromisedStatus()

func (*Options) InitExpiredStatus

func (o *Options) InitExpiredStatus()

func (*Options) InitInvalidHardwareStatus

func (o *Options) InitInvalidHardwareStatus()

func (*Options) InitInvalidSignatureStatus

func (o *Options) InitInvalidSignatureStatus()

func (*Options) InitValidStatus

func (o *Options) InitValidStatus()

func (*Options) IsValid

func (o *Options) IsValid() bool

func (*Options) Key

func (o *Options) Key() string

type Product

type Product struct {
	Name    string `json:"name" yaml:"name" bson:"name"`
	Feature string `json:"feature" yaml:"feature" bson:"feature"`
}

type Raw

type Raw struct {
	Name     string `json:"name" yaml:"name" bson:"name"`
	Type     string `json:"type" yaml:"type" bson:"type"`
	Hostname string `json:"hostname" yaml:"hostname" bson:"hostname"`
	Product  string `json:"product" yaml:"product" bson:"product"`
	Feature  string `json:"feature" yaml:"feature" bson:"feature"`
	Quantity string `json:"quantity" yaml:"quantity" bson:"quantity"`
	SLA      string `json:"sla" yaml:"sla" bson:"sla"`
	Serial   string `json:"serial" yaml:"serial" bson:"serial"`
	Check    int    `json:"check" yaml:"check" bson:"check"`
	IssueBy  string `json:"issueby" yaml:"issueby" bson:"issueby"`
	IssueTo  string `json:"issueto" yaml:"issueto" bson:"issueto"`
	Hardware string `json:"hardware" yaml:"hardware" bson:"hardware"`
	Expiry   string `json:"expiry" yaml:"expiry" bson:"expiry"`
	Date     string `json:"date" yaml:"date" bson:"date"`
	Days     int    `json:"days" yaml:"days" bson:"days"`
}

func (*Raw) IsUnlicense

func (r *Raw) IsUnlicense() bool

type Verification

type Verification struct {
	Options     `json:"license" yaml:"license" bson:"license"`
	EffectNodes []Node `json:"effectNodes" yaml:"effectNodes" bson:"effectNodes"`
}

Jump to

Keyboard shortcuts

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