Documentation ¶
Index ¶
- type Catalog
- func (bc *Catalog) BundleNames() []string
- func (bc *Catalog) Count() int
- func (bc *Catalog) CurrentEpoch() uint64
- func (bc *Catalog) EpochAcked(acked uint64)
- func (bc *Catalog) Find(name string) *config.Bundle
- func (bc *Catalog) IsChanged() bool
- func (bc *Catalog) Len() int
- func (bc *Catalog) MarkReady(name string)
- func (bc *Catalog) Reconnected()
- func (bc *Catalog) Remove(name string)
- func (bc *Catalog) Replace(bundles []*config.Bundle) bool
- type LargestFirst
- type VersionList
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 (*Catalog) BundleNames ¶
BundleNames returns a unique list of bundles stored
func (*Catalog) CurrentEpoch ¶
CurrentEpoch returns the catalog's current epoch
func (*Catalog) EpochAcked ¶
EpochAcked updates the catalog's state to reflect the latest acked epoch
func (*Catalog) Find ¶
Find retrieves a config.Bundle instance by name. returned if the entry doesn't exist.
func (*Catalog) IsChanged ¶
IsChanged returns true if the catalog has been modified since the last announcement.
func (*Catalog) MarkReady ¶
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.
type LargestFirst ¶
LargestFirst sorts versions in descending order
func (LargestFirst) Less ¶
func (nf LargestFirst) Less(i, j int) bool
Less 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) 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