storage

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDir

func LoadDir(cid, dir string, reg *LicenseRegistry) error

Types

type LicenseQueue

type LicenseQueue []*v1alpha1.License

A LicenseQueue implements heap.Interface and holds Items.

func (LicenseQueue) Len

func (pq LicenseQueue) Len() int

func (LicenseQueue) Less

func (pq LicenseQueue) Less(i, j int) bool

func (*LicenseQueue) Pop

func (pq *LicenseQueue) Pop() any

func (*LicenseQueue) Push

func (pq *LicenseQueue) Push(x any)

func (LicenseQueue) Swap

func (pq LicenseQueue) Swap(i, j int)

type LicenseRegistry

type LicenseRegistry struct {
	// contains filtered or unexported fields
}

func NewLicenseRegistry

func NewLicenseRegistry(cacheDir string, rb *RecordBook) *LicenseRegistry

func (*LicenseRegistry) Add

func (*LicenseRegistry) Get

func (r *LicenseRegistry) Get(id string) (*Record, bool)

func (*LicenseRegistry) LicenseForFeature

func (r *LicenseRegistry) LicenseForFeature(feature string) (*v1alpha1.License, bool)

func (*LicenseRegistry) List

func (r *LicenseRegistry) List() []*Record

type Record

type Record struct {
	License  *v1alpha1.License
	Contract *v1alpha1.Contract
}

type RecordBook

type RecordBook struct {
	// contains filtered or unexported fields
}

func NewRecordBook

func NewRecordBook() *RecordBook

func (*RecordBook) Delete

func (r *RecordBook) Delete(id string)

func (*RecordBook) Record

func (r *RecordBook) Record(id string, features []string, user user.Info)

func (*RecordBook) UsedBy

Jump to

Keyboard shortcuts

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