Versions in this module Expand all Collapse all v0 v0.8.3 Apr 27, 2018 Changes in this version + const DefaultMaxTemplateEventRate + const MB + const OriginEnd + const OriginStart + const ReasonDelay + const ReasonNoRestartsAllowed + const ReasonUnrecoverableErrror + const ReasonWithinPolicy + func NewTokenFuture() *tokenFuture + type AllocCounter interface + NumAllocs func() int + type AllocGarbageCollector struct + func NewAllocGarbageCollector(logger *log.Logger, statsCollector stats.NodeStatsCollector, ac AllocCounter, ...) *AllocGarbageCollector + func (a *AllocGarbageCollector) Collect(allocID string) bool + func (a *AllocGarbageCollector) CollectAll() + func (a *AllocGarbageCollector) MakeRoomFor(allocations []*structs.Allocation) error + func (a *AllocGarbageCollector) MarkForCollection(ar *AllocRunner) + func (a *AllocGarbageCollector) Run() + func (a *AllocGarbageCollector) Stop() + func (a *AllocGarbageCollector) Trigger() + type AllocRunner struct + func NewAllocRunner(logger *log.Logger, config *config.Config, stateDB *bolt.DB, ...) *AllocRunner + func (r *AllocRunner) Alloc() *structs.Allocation + func (r *AllocRunner) Destroy() + func (r *AllocRunner) DestroyContext() error + func (r *AllocRunner) DestroyState() error + func (r *AllocRunner) GetAllocDir() *allocdir.AllocDir + func (r *AllocRunner) GetListener() *cstructs.AllocListener + func (r *AllocRunner) IsDestroyed() bool + func (r *AllocRunner) IsMigrating() bool + func (r *AllocRunner) IsWaiting() bool + func (r *AllocRunner) LatestAllocStats(taskFilter string) (*cstructs.AllocResourceUsage, error) + func (r *AllocRunner) RestoreState() error + func (r *AllocRunner) Run() + func (r *AllocRunner) SaveState() error + func (r *AllocRunner) StatsReporter() AllocStatsReporter + func (r *AllocRunner) Update(update *structs.Allocation) + func (r *AllocRunner) WaitCh() <-chan struct{} + type AllocStateUpdater func(alloc *structs.Allocation) + type AllocStatsReporter interface + LatestAllocStats func(taskFilter string) (*cstructs.AllocResourceUsage, error) + type Allocations struct + func (a *Allocations) GarbageCollect(args *nstructs.AllocSpecificRequest, reply *nstructs.GenericResponse) error + func (a *Allocations) GarbageCollectAll(args *nstructs.NodeSpecificRequest, reply *nstructs.GenericResponse) error + func (a *Allocations) Stats(args *cstructs.AllocStatsRequest, reply *cstructs.AllocStatsResponse) error + type Client struct + func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, ...) (*Client, error) + func TestClient(t testing.T, cb func(c *config.Config)) *Client + func (c *Client) ClientRPC(method string, args interface{}, reply interface{}) error + func (c *Client) CollectAllAllocs() + func (c *Client) CollectAllocation(allocID string) bool + func (c *Client) Datacenter() string + func (c *Client) GetAllocFS(allocID string) (allocdir.AllocDirFS, error) + func (c *Client) GetAllocStats(allocID string) (AllocStatsReporter, error) + func (c *Client) GetClientAlloc(allocID string) (*structs.Allocation, error) + func (c *Client) GetConfig() *config.Config + func (c *Client) GetServers() []string + func (c *Client) LatestHostStats() *stats.HostStats + func (c *Client) Leave() error + func (c *Client) Node() *structs.Node + func (c *Client) NodeID() string + func (c *Client) NumAllocs() int + func (c *Client) Ping(srv net.Addr) error + func (c *Client) RPC(method string, args interface{}, reply interface{}) error + func (c *Client) RPCMajorVersion() int + func (c *Client) RPCMinorVersion() int + func (c *Client) Region() string + func (c *Client) Reload(newConfig *config.Config) error + func (c *Client) RemoteStreamingRpcHandler(method string) (structs.StreamingRpcHandler, error) + func (c *Client) ResolveToken(secretID string) (*acl.ACL, error) + func (c *Client) SetServers(in []string) error + func (c *Client) Shutdown() error + func (c *Client) Stats() map[string]map[string]string + func (c *Client) StatsReporter() ClientStatsReporter + func (c *Client) StreamingRpcHandler(method string) (structs.StreamingRpcHandler, error) + func (c *Client) ValidateMigrateToken(allocID, migrateToken string) bool + type ClientStats struct + func (s *ClientStats) Stats(args *nstructs.NodeSpecificRequest, reply *structs.ClientStatsResponse) error + type ClientStatsReporter interface + GetAllocStats func(allocID string) (AllocStatsReporter, error) + LatestHostStats func() *stats.HostStats + type ConsulServiceAPI interface + AllocRegistrations func(allocID string) (*consul.AllocRegistration, error) + RegisterTask func(allocID string, task *structs.Task, restarter consul.TaskRestarter, ...) error + RemoveTask func(allocID string, task *structs.Task) + UpdateTask func(allocID string, existing, newTask *structs.Task, restart consul.TaskRestarter, ...) error + type FileSystem struct + func NewFileSystemEndpoint(c *Client) *FileSystem + func (f *FileSystem) List(args *cstructs.FsListRequest, reply *cstructs.FsListResponse) error + func (f *FileSystem) Stat(args *cstructs.FsStatRequest, reply *cstructs.FsStatResponse) error + type FingerprintManager struct + func NewFingerprintManager(getConfig func() *config.Config, node *structs.Node, shutdownCh chan struct{}, ...) *FingerprintManager + func (fp *FingerprintManager) Run() error + type GCAlloc struct + type GCAllocPQImpl []*GCAlloc + func (pq *GCAllocPQImpl) Pop() interface{} + func (pq *GCAllocPQImpl) Push(x interface{}) + func (pq GCAllocPQImpl) Len() int + func (pq GCAllocPQImpl) Less(i, j int) bool + func (pq GCAllocPQImpl) Swap(i, j int) + type GCConfig struct + DiskUsageThreshold float64 + InodeUsageThreshold float64 + Interval time.Duration + MaxAllocs int + ParallelDestroys int + ReservedDiskMB int + type IndexedGCAllocPQ struct + func NewIndexedGCAllocPQ() *IndexedGCAllocPQ + func (i *IndexedGCAllocPQ) Length() int + func (i *IndexedGCAllocPQ) Pop() *GCAlloc + func (i *IndexedGCAllocPQ) Push(ar *AllocRunner) bool + func (i *IndexedGCAllocPQ) Remove(allocID string) *GCAlloc + type RestartTracker struct + func (r *RestartTracker) GetReason() string + func (r *RestartTracker) GetState() (string, time.Duration) + func (r *RestartTracker) SetPolicy(policy *structs.RestartPolicy) + func (r *RestartTracker) SetRestartTriggered(failure bool) *RestartTracker + func (r *RestartTracker) SetStartError(err error) *RestartTracker + func (r *RestartTracker) SetWaitResult(res *dstructs.WaitResult) *RestartTracker + type SignalEvent struct + type TaskHooks interface + EmitEvent func(source, message string) + Kill func(source, reason string, fail bool) + Restart func(source, reason string, failure bool) + Signal func(source, reason string, s os.Signal) error + UnblockStart func(source string) + type TaskRunner struct + func NewTaskRunner(logger *log.Logger, config *config.Config, stateDB *bolt.DB, ...) *TaskRunner + func (r *TaskRunner) Destroy(event *structs.TaskEvent) + func (r *TaskRunner) DestroyState() error + func (r *TaskRunner) EmitEvent(source, message string) + func (r *TaskRunner) Kill(source, reason string, fail bool) + func (r *TaskRunner) LatestResourceUsage() *cstructs.TaskResourceUsage + func (r *TaskRunner) MarkReceived() + func (r *TaskRunner) Restart(source, reason string, failure bool) + func (r *TaskRunner) RestoreState() (string, error) + func (r *TaskRunner) Run() + func (r *TaskRunner) SaveState() error + func (r *TaskRunner) Signal(source, reason string, s os.Signal) error + func (r *TaskRunner) UnblockStart(source string) + func (r *TaskRunner) Update(update *structs.Allocation) + func (r *TaskRunner) WaitCh() <-chan struct{} + type TaskStateUpdater func(taskName, state string, event *structs.TaskEvent, lazySync bool) + type TaskTemplateManager struct + func NewTaskTemplateManager(config *TaskTemplateManagerConfig) (*TaskTemplateManager, error) + func (tm *TaskTemplateManager) Stop() + type TaskTemplateManagerConfig struct + ClientConfig *config.Config + EnvBuilder *env.Builder + Hooks TaskHooks + MaxTemplateEventRate time.Duration + TaskDir string + Templates []*structs.Template + VaultToken string + func (c *TaskTemplateManagerConfig) Validate() error