Documentation ¶
Index ¶
- Constants
- func NewEtcdEventStream(kAPI etcd.KeysAPI, rootPrefix string) pkg.EventStream
- type ClusterRegistry
- type EtcdRegistry
- func (r *EtcdRegistry) ClearUnitHeartbeat(name string)
- func (r *EtcdRegistry) CreateMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error)
- func (r *EtcdRegistry) CreateUnit(u *job.Unit) error
- func (r *EtcdRegistry) DeleteMachineMetadata(machID string, key string) error
- func (r *EtcdRegistry) DestroyUnit(name string) error
- func (r *EtcdRegistry) EngineVersion() (int, error)
- func (r *EtcdRegistry) IsRegistryReady() bool
- func (r *EtcdRegistry) LatestDaemonVersion() (*semver.Version, error)
- func (r *EtcdRegistry) MachineState(machID string) (machine.MachineState, error)
- func (r *EtcdRegistry) Machines() (machines []machine.MachineState, err error)
- func (r *EtcdRegistry) RemoveMachineState(machID string) error
- func (r *EtcdRegistry) RemoveUnitState(jobName string) error
- func (r *EtcdRegistry) SaveUnitState(jobName string, unitState *unit.UnitState, ttl time.Duration)
- func (r *EtcdRegistry) Schedule() ([]job.ScheduledUnit, error)
- func (r *EtcdRegistry) ScheduleUnit(name string, machID string) error
- func (r *EtcdRegistry) ScheduledUnit(name string) (*job.ScheduledUnit, error)
- func (r *EtcdRegistry) SetMachineMetadata(machID string, key string, value string) error
- func (r *EtcdRegistry) SetMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error)
- func (r *EtcdRegistry) SetUnitTargetState(name string, state job.JobState) error
- func (r *EtcdRegistry) Unit(name string) (*job.Unit, error)
- func (r *EtcdRegistry) UnitHeartbeat(name, machID string, ttl time.Duration) error
- func (r *EtcdRegistry) UnitState(name string) (state *unit.UnitState, err error)
- func (r *EtcdRegistry) UnitStates() (states []*unit.UnitState, err error)
- func (r *EtcdRegistry) Units() ([]job.Unit, error)
- func (r *EtcdRegistry) UnscheduleUnit(name, machID string) error
- func (r *EtcdRegistry) UpdateEngineVersion(from, to int) error
- func (r *EtcdRegistry) UseEtcdRegistry() bool
- type FakeClusterRegistry
- type FakeLeaseRegistry
- func (fl *FakeLeaseRegistry) AcquireLease(name, machID string, ver int, ttl time.Duration) (lease.Lease, error)
- func (fl *FakeLeaseRegistry) GetLease(name string) (lease.Lease, error)
- func (fl *FakeLeaseRegistry) SetLease(name, machID string, ver int, ttl time.Duration) *fakeLease
- func (fl *FakeLeaseRegistry) StealLease(name, machID string, ver int, ttl time.Duration, idx uint64) (lease.Lease, error)
- type FakeRegistry
- func (f *FakeRegistry) ClearUnitHeartbeat(string)
- func (f *FakeRegistry) CreateUnit(u *job.Unit) error
- func (f *FakeRegistry) DeleteMachineMetadata(machID string, key string) error
- func (f *FakeRegistry) DestroyUnit(name string) error
- func (f *FakeRegistry) IsRegistryReady() bool
- func (f *FakeRegistry) MachineState(machID string) (machine.MachineState, error)
- func (f *FakeRegistry) Machines() ([]machine.MachineState, error)
- func (f *FakeRegistry) RemoveUnitState(jobName string) error
- func (f *FakeRegistry) SaveUnitState(jobName string, unitState *unit.UnitState, ttl time.Duration)
- func (f *FakeRegistry) Schedule() ([]job.ScheduledUnit, error)
- func (f *FakeRegistry) ScheduleUnit(name string, machID string) error
- func (f *FakeRegistry) ScheduledUnit(name string) (*job.ScheduledUnit, error)
- func (f *FakeRegistry) SetJobs(jobs []job.Job)
- func (f *FakeRegistry) SetMachineMetadata(machID string, key string, value string) error
- func (f *FakeRegistry) SetMachines(machines []machine.MachineState)
- func (f *FakeRegistry) SetUnitStates(states []unit.UnitState)
- func (f *FakeRegistry) SetUnitTargetState(name string, target job.JobState) error
- func (f *FakeRegistry) Unit(name string) (*job.Unit, error)
- func (f *FakeRegistry) UnitHeartbeat(name, machID string, ttl time.Duration) error
- func (f *FakeRegistry) UnitState(unitName string) (*unit.UnitState, error)
- func (f *FakeRegistry) UnitStates() ([]*unit.UnitState, error)
- func (f *FakeRegistry) Units() ([]job.Unit, error)
- func (f *FakeRegistry) UseEtcdRegistry() bool
- type MUSKey
- type MUSKeys
- type Registry
- type UnitRegistry
Constants ¶
const ( // Occurs when any Job's target is touched JobTargetChangeEvent = pkg.Event("JobTargetChangeEvent") // Occurs when any Job's target state is touched JobTargetStateChangeEvent = pkg.Event("JobTargetStateChangeEvent") )
const DefaultKeyPrefix = "/_coreos.com/fleet/"
Variables ¶
This section is empty.
Functions ¶
func NewEtcdEventStream ¶ added in v0.7.0
func NewEtcdEventStream(kAPI etcd.KeysAPI, rootPrefix string) pkg.EventStream
Types ¶
type ClusterRegistry ¶ added in v0.8.2
type ClusterRegistry interface { LatestDaemonVersion() (*semver.Version, error) // EngineVersion returns the current version of the cluster. If the // cluster does not yet have a version, zero will be returned. If // any error occurs, an error object will be returned. In this case, // the returned version number should be ignored. EngineVersion() (int, error) // UpdateEngineVersion attempts to compare-and-swap the cluster version // from one value to another. Any failures in this process will be // indicated by the returned error object. A nil value will be returned // on success. UpdateEngineVersion(from, to int) error }
type EtcdRegistry ¶ added in v0.3.1
type EtcdRegistry struct {
// contains filtered or unexported fields
}
EtcdRegistry fulfils the Registry interface and uses etcd as a backend
func NewEtcdRegistry ¶ added in v0.8.2
func NewEtcdRegistry(kAPI etcd.KeysAPI, keyPrefix string) *EtcdRegistry
func (*EtcdRegistry) ClearUnitHeartbeat ¶ added in v0.7.0
func (r *EtcdRegistry) ClearUnitHeartbeat(name string)
func (*EtcdRegistry) CreateMachineState ¶ added in v0.13.0
func (r *EtcdRegistry) CreateMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error)
func (*EtcdRegistry) CreateUnit ¶ added in v0.7.0
func (r *EtcdRegistry) CreateUnit(u *job.Unit) error
CreateUnit attempts to store a Unit and its associated unit file in the registry
func (*EtcdRegistry) DeleteMachineMetadata ¶ added in v1.0.0
func (r *EtcdRegistry) DeleteMachineMetadata(machID string, key string) error
func (*EtcdRegistry) DestroyUnit ¶ added in v0.7.0
func (r *EtcdRegistry) DestroyUnit(name string) error
DestroyUnit removes a Job object from the repository. It does not yet remove underlying UnitFiles from the repository.
func (*EtcdRegistry) EngineVersion ¶ added in v0.8.2
func (r *EtcdRegistry) EngineVersion() (int, error)
EngineVersion implements the ClusterRegistry interface
func (*EtcdRegistry) IsRegistryReady ¶ added in v1.0.0
func (r *EtcdRegistry) IsRegistryReady() bool
func (*EtcdRegistry) LatestDaemonVersion ¶ added in v0.8.2
func (r *EtcdRegistry) LatestDaemonVersion() (*semver.Version, error)
LatestDaemonVersion attempts to retrieve the latest version of fleetd that has been registered in the Registry. It returns the version if it can be determined (or nil otherwise), and any error encountered.
func (*EtcdRegistry) MachineState ¶ added in v1.0.0
func (r *EtcdRegistry) MachineState(machID string) (machine.MachineState, error)
func (*EtcdRegistry) Machines ¶ added in v0.5.1
func (r *EtcdRegistry) Machines() (machines []machine.MachineState, err error)
func (*EtcdRegistry) RemoveMachineState ¶ added in v0.3.1
func (r *EtcdRegistry) RemoveMachineState(machID string) error
func (*EtcdRegistry) RemoveUnitState ¶ added in v0.3.1
func (r *EtcdRegistry) RemoveUnitState(jobName string) error
Delete the state from the Registry for the given Job's Unit
func (*EtcdRegistry) SaveUnitState ¶ added in v0.3.1
SaveUnitState persists the given UnitState to the Registry
func (*EtcdRegistry) Schedule ¶ added in v0.7.0
func (r *EtcdRegistry) Schedule() ([]job.ScheduledUnit, error)
Schedule returns all ScheduledUnits known by fleet, ordered by name
func (*EtcdRegistry) ScheduleUnit ¶ added in v0.7.0
func (r *EtcdRegistry) ScheduleUnit(name string, machID string) error
func (*EtcdRegistry) ScheduledUnit ¶ added in v0.7.0
func (r *EtcdRegistry) ScheduledUnit(name string) (*job.ScheduledUnit, error)
ScheduledUnit retrieves the ScheduledUnit by the given name from the Registry. Returns nil if no such ScheduledUnit exists, and any error encountered.
func (*EtcdRegistry) SetMachineMetadata ¶ added in v1.0.0
func (r *EtcdRegistry) SetMachineMetadata(machID string, key string, value string) error
func (*EtcdRegistry) SetMachineState ¶ added in v0.3.1
func (r *EtcdRegistry) SetMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error)
func (*EtcdRegistry) SetUnitTargetState ¶ added in v0.7.0
func (r *EtcdRegistry) SetUnitTargetState(name string, state job.JobState) error
func (*EtcdRegistry) Unit ¶ added in v0.7.0
func (r *EtcdRegistry) Unit(name string) (*job.Unit, error)
Unit retrieves the Unit by the given name from the Registry. Returns nil if no such Unit exists, and any error encountered.
func (*EtcdRegistry) UnitHeartbeat ¶ added in v0.7.0
func (r *EtcdRegistry) UnitHeartbeat(name, machID string, ttl time.Duration) error
func (*EtcdRegistry) UnitState ¶ added in v1.0.0
func (r *EtcdRegistry) UnitState(name string) (state *unit.UnitState, err error)
UnitState returns a single UnitState stored in the registry for a given unit name.
func (*EtcdRegistry) UnitStates ¶ added in v0.7.0
func (r *EtcdRegistry) UnitStates() (states []*unit.UnitState, err error)
UnitStates returns a list of all UnitStates stored in the registry, sorted by unit name and then machine ID.
func (*EtcdRegistry) Units ¶ added in v0.7.0
func (r *EtcdRegistry) Units() ([]job.Unit, error)
Units lists all Units stored in the Registry, ordered by name. This includes both global and non-global units.
func (*EtcdRegistry) UnscheduleUnit ¶ added in v0.7.0
func (r *EtcdRegistry) UnscheduleUnit(name, machID string) error
func (*EtcdRegistry) UpdateEngineVersion ¶ added in v0.8.2
func (r *EtcdRegistry) UpdateEngineVersion(from, to int) error
UpdateEngineVersion implements the ClusterRegistry interface
func (*EtcdRegistry) UseEtcdRegistry ¶ added in v1.0.0
func (r *EtcdRegistry) UseEtcdRegistry() bool
type FakeClusterRegistry ¶ added in v0.8.2
type FakeClusterRegistry struct {
// contains filtered or unexported fields
}
func NewFakeClusterRegistry ¶ added in v0.8.2
func NewFakeClusterRegistry(dVersion *semver.Version, eVersion int) *FakeClusterRegistry
func (*FakeClusterRegistry) EngineVersion ¶ added in v0.8.2
func (fc *FakeClusterRegistry) EngineVersion() (int, error)
func (*FakeClusterRegistry) LatestDaemonVersion ¶ added in v0.8.2
func (fc *FakeClusterRegistry) LatestDaemonVersion() (*semver.Version, error)
func (*FakeClusterRegistry) UpdateEngineVersion ¶ added in v0.8.2
func (fc *FakeClusterRegistry) UpdateEngineVersion(from, to int) error
type FakeLeaseRegistry ¶ added in v0.8.2
type FakeLeaseRegistry struct {
// contains filtered or unexported fields
}
func NewFakeLeaseRegistry ¶ added in v0.8.2
func NewFakeLeaseRegistry() *FakeLeaseRegistry
func (*FakeLeaseRegistry) AcquireLease ¶ added in v0.8.2
func (*FakeLeaseRegistry) GetLease ¶ added in v0.8.2
func (fl *FakeLeaseRegistry) GetLease(name string) (lease.Lease, error)
type FakeRegistry ¶ added in v0.4.0
type FakeRegistry struct { // Not all methods required by the Registry interface are implemented // by the FakeRegistry. Any calls to these unimplemented methods will // result in a panic. Registry sync.RWMutex // contains filtered or unexported fields }
func NewFakeRegistry ¶ added in v0.4.0
func NewFakeRegistry() *FakeRegistry
func (*FakeRegistry) ClearUnitHeartbeat ¶ added in v0.7.0
func (f *FakeRegistry) ClearUnitHeartbeat(string)
func (*FakeRegistry) CreateUnit ¶ added in v0.7.0
func (f *FakeRegistry) CreateUnit(u *job.Unit) error
func (*FakeRegistry) DeleteMachineMetadata ¶ added in v1.0.0
func (f *FakeRegistry) DeleteMachineMetadata(machID string, key string) error
func (*FakeRegistry) DestroyUnit ¶ added in v0.7.0
func (f *FakeRegistry) DestroyUnit(name string) error
func (*FakeRegistry) IsRegistryReady ¶ added in v1.0.0
func (f *FakeRegistry) IsRegistryReady() bool
func (*FakeRegistry) MachineState ¶ added in v1.0.0
func (f *FakeRegistry) MachineState(machID string) (machine.MachineState, error)
func (*FakeRegistry) Machines ¶ added in v0.5.1
func (f *FakeRegistry) Machines() ([]machine.MachineState, error)
func (*FakeRegistry) RemoveUnitState ¶ added in v0.6.0
func (f *FakeRegistry) RemoveUnitState(jobName string) error
func (*FakeRegistry) SaveUnitState ¶ added in v0.4.0
func (*FakeRegistry) Schedule ¶ added in v0.7.0
func (f *FakeRegistry) Schedule() ([]job.ScheduledUnit, error)
func (*FakeRegistry) ScheduleUnit ¶ added in v0.7.0
func (f *FakeRegistry) ScheduleUnit(name string, machID string) error
func (*FakeRegistry) ScheduledUnit ¶ added in v0.7.0
func (f *FakeRegistry) ScheduledUnit(name string) (*job.ScheduledUnit, error)
func (*FakeRegistry) SetJobs ¶ added in v0.4.0
func (f *FakeRegistry) SetJobs(jobs []job.Job)
func (*FakeRegistry) SetMachineMetadata ¶ added in v1.0.0
func (f *FakeRegistry) SetMachineMetadata(machID string, key string, value string) error
func (*FakeRegistry) SetMachines ¶ added in v0.4.0
func (f *FakeRegistry) SetMachines(machines []machine.MachineState)
func (*FakeRegistry) SetUnitStates ¶ added in v0.4.0
func (f *FakeRegistry) SetUnitStates(states []unit.UnitState)
func (*FakeRegistry) SetUnitTargetState ¶ added in v0.7.0
func (f *FakeRegistry) SetUnitTargetState(name string, target job.JobState) error
func (*FakeRegistry) Unit ¶ added in v0.7.0
func (f *FakeRegistry) Unit(name string) (*job.Unit, error)
func (*FakeRegistry) UnitHeartbeat ¶ added in v0.7.0
func (f *FakeRegistry) UnitHeartbeat(name, machID string, ttl time.Duration) error
func (*FakeRegistry) UnitState ¶ added in v1.0.0
func (f *FakeRegistry) UnitState(unitName string) (*unit.UnitState, error)
func (*FakeRegistry) UnitStates ¶ added in v0.7.0
func (f *FakeRegistry) UnitStates() ([]*unit.UnitState, error)
func (*FakeRegistry) UseEtcdRegistry ¶ added in v1.0.0
func (f *FakeRegistry) UseEtcdRegistry() bool
type MUSKeys ¶ added in v0.7.0
type MUSKeys []MUSKey
MUSKeys provides for sorting of UnitStates by their MUSKey
type Registry ¶
type Registry interface { ClearUnitHeartbeat(name string) CreateMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error) CreateUnit(*job.Unit) error DestroyUnit(string) error UnitHeartbeat(name, machID string, ttl time.Duration) error Machines() ([]machine.MachineState, error) RemoveMachineState(machID string) error RemoveUnitState(jobName string) error SaveUnitState(jobName string, unitState *unit.UnitState, ttl time.Duration) ScheduleUnit(name, machID string) error SetUnitTargetState(name string, state job.JobState) error SetMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error) MachineState(machID string) (machine.MachineState, error) UnscheduleUnit(name, machID string) error SetMachineMetadata(machID string, key string, value string) error DeleteMachineMetadata(machID string, key string) error IsRegistryReady() bool UseEtcdRegistry() bool UnitRegistry }