bundle

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

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

Catalog tracks installed and available bundles. Catalog reads and writes are guarded by a single RWMutex.

func NewCatalog

func NewCatalog() *Catalog

NewCatalog returns a initialized and empty catalog.

func (*Catalog) BundleNames

func (bc *Catalog) BundleNames() []string

BundleNames returns a unique list of bundles stored

func (*Catalog) Count

func (bc *Catalog) Count() int

Count returns the number of stored entries.

func (*Catalog) CurrentEpoch

func (bc *Catalog) CurrentEpoch() uint64

CurrentEpoch returns the catalog's current epoch

func (*Catalog) EpochAcked

func (bc *Catalog) EpochAcked(acked uint64)

EpochAcked updates the catalog's state to reflect the latest acked epoch

func (*Catalog) Find

func (bc *Catalog) Find(name string) *config.Bundle

Find retrieves a config.Bundle instance by name. returned if the entry doesn't exist.

func (*Catalog) IsChanged

func (bc *Catalog) IsChanged() bool

IsChanged returns true if the catalog has been modified since the last announcement.

func (*Catalog) Len

func (bc *Catalog) Len() int

Len returns the number of bundle versions stored

func (*Catalog) MarkReady

func (bc *Catalog) MarkReady(name string)

MarkReady updates the catalog entry to indicate the bundle is ready for execution

func (*Catalog) Reconnected

func (bc *Catalog) Reconnected()

Reconnected increments the catalog's epoch to indicate the Relay has reconnected to Cog and should re-announce.

func (*Catalog) Remove

func (bc *Catalog) Remove(name string)

Remove deletes the named config.Bundle instance from the catalog.

func (*Catalog) Replace

func (bc *Catalog) Replace(bundles []*config.Bundle) bool

Replace atomically replaces the current bundle catalog contents with new a new snapshot. Returns true if at least one config.Bundle entry was added or deleted.

type LargestFirst

type LargestFirst []*semver.Version

LargestFirst sorts versions in descending order

func (LargestFirst) Len

func (nf LargestFirst) Len() int

Len is required by Sort.interface

func (LargestFirst) Less

func (nf LargestFirst) Less(i, j int) bool

Less is required by Sort.interface

func (LargestFirst) Swap

func (nf LargestFirst) Swap(i, j int)

Swap is required by Sort.interface

type VersionList

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

VersionList is a list of semantic versions. It uses LargestFirst to keep versions in descending order.

func NewVersionList

func NewVersionList() *VersionList

NewVersionList constructs an empty version list

func (*VersionList) Add

func (vlp *VersionList) Add(version *semver.Version)

Add adds a new version to the list and ensures the list stays sorted in descending order.

func (*VersionList) Largest

func (vlp *VersionList) Largest() *semver.Version

Largest returns the largest version contained in the list

func (*VersionList) Len

func (vlp *VersionList) Len() int

Len returns current size

func (*VersionList) Remove

func (vlp *VersionList) Remove(version *semver.Version)

Remove a version

func (*VersionList) Versions

func (vlp *VersionList) Versions() []*semver.Version

Versions returns a copy of the list of stored versions

Jump to

Keyboard shortcuts

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