Documentation ¶
Index ¶
- Constants
- type EventStream
- type LegacyJobPayload
- type Registry
- func (r *Registry) CheckJobPulse(jobName string) (string, bool)
- func (r *Registry) ClearJobHeartbeat(jobName string)
- func (r *Registry) ClearJobTarget(jobName, machID string) error
- func (r *Registry) CreateJob(j *job.Job) (err error)
- func (r *Registry) CreateJobOffer(jo *job.JobOffer) error
- func (r *Registry) CreateSignatureSet(ss *sign.SignatureSet) error
- func (r *Registry) DestroyJob(jobName string)
- func (r *Registry) DestroySignatureSet(tag string)
- func (r *Registry) GetActiveMachines() []machine.MachineState
- func (r *Registry) GetAllJobs() []job.Job
- func (r *Registry) GetDebugInfo() (string, error)
- func (r *Registry) GetJob(jobName string) (j *job.Job)
- func (r *Registry) GetJobTarget(jobName string) string
- func (r *Registry) GetJobTargetState(jobName string) *job.JobState
- func (r *Registry) GetMachineState(machID string) *machine.MachineState
- func (r *Registry) GetSignatureSet(tag string) *sign.SignatureSet
- func (r *Registry) GetSignatureSetOfJob(name string) *sign.SignatureSet
- func (r *Registry) JobHeartbeat(jobName, agentMachID string, ttl time.Duration) error
- func (r *Registry) LockJob(jobName, context string) *TimedResourceMutex
- func (r *Registry) LockJobOffer(jobName, context string) *TimedResourceMutex
- func (r *Registry) LockMachine(machID, context string) *TimedResourceMutex
- func (r *Registry) RemoveMachineState(machID string) error
- func (r *Registry) RemoveUnitState(jobName string) error
- func (r *Registry) ResolveJobOffer(jobName string) error
- func (r *Registry) SaveUnitState(jobName string, unitState *unit.UnitState)
- func (r *Registry) ScheduleJob(jobName string, machID string) error
- func (r *Registry) SetJobTargetState(jobName string, state job.JobState) error
- func (r *Registry) SetMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error)
- func (r *Registry) SubmitJobBid(jb *job.JobBid)
- func (r *Registry) UnresolvedJobOffers() []job.JobOffer
- type TimedResourceMutex
Constants ¶
const DefaultKeyPrefix = "/_coreos.com/fleet/"
const (
// ResourceMutexTTL is the number of seconds to allow a mutex to be held on a resource
ResourceMutexTTL = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
func NewEventStream ¶
func NewEventStream(client *etcd.Client, registry *Registry) *EventStream
type LegacyJobPayload ¶ added in v0.3.0
LegacyJobPayload deals with the legacy concept of a "JobPayload" (deprecated by Units). The associated marshaling/unmarshaling methods deal with Payloads encoded in this legacy format.
func (*LegacyJobPayload) UnmarshalJSON ¶ added in v0.3.0
func (ljp *LegacyJobPayload) UnmarshalJSON(data []byte) error
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) CheckJobPulse ¶ added in v0.3.0
func (*Registry) ClearJobHeartbeat ¶ added in v0.3.0
func (*Registry) ClearJobTarget ¶ added in v0.3.0
func (*Registry) CreateJob ¶
CreateJob attempts to store a Job and its associated Unit in the registry
func (*Registry) CreateJobOffer ¶
CreateJobOffer attempts to store a JobOffer and a reference to its associated Job in the repository
func (*Registry) CreateSignatureSet ¶ added in v0.2.0
func (r *Registry) CreateSignatureSet(ss *sign.SignatureSet) error
CreateSignatureSet stores the given SignatureSet in the repository
func (*Registry) DestroyJob ¶ added in v0.3.0
DestroyJob removes a Job object from the repository, along with any legacy associated Payload and SignatureSet. It does not yet remove underlying Units from the repository.
func (*Registry) DestroySignatureSet ¶ added in v0.2.0
DestroySignatureSet destroys the SignatureSet associated with the given tag
func (*Registry) GetActiveMachines ¶
func (r *Registry) GetActiveMachines() []machine.MachineState
Describe all active Machines
func (*Registry) GetAllJobs ¶
GetAllJobs lists all Jobs known by the Registry
func (*Registry) GetDebugInfo ¶ added in v0.2.0
func (*Registry) GetJob ¶
GetJob looks for a Job of the given name in the Registry. It returns a fully hydrated Job on success, or nil on any kind of failure.
func (*Registry) GetJobTarget ¶
GetJobTarget looks up where the given job is scheduled. If the job has been scheduled, the ID the target machine is returned. Otherwise, an empty string is returned.
func (*Registry) GetJobTargetState ¶ added in v0.3.0
func (*Registry) GetMachineState ¶
func (r *Registry) GetMachineState(machID string) *machine.MachineState
Get Machine object from etcd
func (*Registry) GetSignatureSet ¶ added in v0.2.0
func (r *Registry) GetSignatureSet(tag string) *sign.SignatureSet
GetSignatureSet returns the SignatureSet associated with the given tag
func (*Registry) GetSignatureSetOfJob ¶ added in v0.3.0
func (r *Registry) GetSignatureSetOfJob(name string) *sign.SignatureSet
GetSignatureSetOfJob retrieves the SignatureSet associated with the given job, or nil if none can be found
func (*Registry) JobHeartbeat ¶ added in v0.3.0
func (*Registry) LockJob ¶ added in v0.1.2
func (r *Registry) LockJob(jobName, context string) *TimedResourceMutex
func (*Registry) LockJobOffer ¶ added in v0.1.2
func (r *Registry) LockJobOffer(jobName, context string) *TimedResourceMutex
func (*Registry) LockMachine ¶ added in v0.1.2
func (r *Registry) LockMachine(machID, context string) *TimedResourceMutex
Attempt to acquire a lock on a given machine for a given amount of time
func (*Registry) RemoveMachineState ¶
Remove Machine object from etcd
func (*Registry) RemoveUnitState ¶ added in v0.3.0
Delete the state from the Registry for the given Job's Unit
func (*Registry) ResolveJobOffer ¶
func (*Registry) SaveUnitState ¶ added in v0.3.0
Persist the changes in a provided Machine's Job
func (*Registry) SetJobTargetState ¶ added in v0.3.0
func (*Registry) SetMachineState ¶
Push Machine object to etcd
func (*Registry) SubmitJobBid ¶
func (*Registry) UnresolvedJobOffers ¶
UnresolvedJobOffers returns a list of hydrated JobOffers from the Registry
type TimedResourceMutex ¶ added in v0.1.2
type TimedResourceMutex struct {
// contains filtered or unexported fields
}
TimedResourceMutex is a proxy to an auto-expiring mutex stored in the Registry. It assumes the mutex creator has initialized a timer.
func (*TimedResourceMutex) Unlock ¶ added in v0.1.2
func (t *TimedResourceMutex) Unlock() error
Unlock will attempt to remove the lock held on the mutex in the Registry.