licenses

package
v0.0.1-dev-a81c22a Latest Latest
Warning

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

Go to latest
Published: May 19, 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"
	NA      = "N/A"
)

Variables

This section is empty.

Functions

func IsNotInstalled

func IsNotInstalled(list []License) bool

func LowerProductsInPlace

func LowerProductsInPlace(products []string)

func SetList

func SetList(list []License)

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 (a *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 License

type License 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() []License

func (*License) GenSearchableObject

func (l *License) GenSearchableObject() License

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 (*License) InitInvalidHardware

func (l *License) InitInvalidHardware()

func (*License) InitInvalidSignature

func (l *License) InitInvalidSignature()

func (*License) IsValid

func (l *License) IsValid() bool

func (*License) Key

func (l *License) Key() string

func (*License) SetCompromised

func (l *License) SetCompromised()

func (*License) SetExpired

func (l *License) SetExpired()

func (*License) SetValid

func (l *License) SetValid()

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 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 {
	License     `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