Documentation
¶
Overview ¶
Package control provides a set of Services (in the Supervisor terminology) that are started by the main sync process.
Index ¶
- Constants
- func GetBus() *pubsub.PubSub
- func MessageFromString(text string) (int, error)
- type CommandMessage
- type HttpServer
- type MemoryStateStore
- func (b *MemoryStateStore) BothConnected() bool
- func (b *MemoryStateStore) LastState() common.SyncState
- func (b *MemoryStateStore) TouchLastOpsTime(t ...time.Time)
- func (b *MemoryStateStore) UpdateConnection(c bool, i model.EndpointInfo) common.SyncState
- func (b *MemoryStateStore) UpdateEndpointStats(s *model.EndpointRootStat, i model.EndpointInfo) common.SyncState
- func (b *MemoryStateStore) UpdateProcessStatus(processStatus model.Status, status ...model.TaskStatus) common.SyncState
- func (b *MemoryStateStore) UpdateSyncStatus(s model.TaskStatus) common.SyncState
- func (b *MemoryStateStore) UpdateWatcherActivity(a bool, i model.EndpointInfo) common.SyncState
- type PatchesRequest
- type PatchesResponse
- type Profiler
- type Scheduler
- type StateStore
- type StdInner
- type Supervisor
- type Syncer
- type TreeRequest
- type TreeResponse
- type Updater
Constants ¶
View Source
const ( TopicGlobal = "cmd" TopicSyncAll = "sync" TopicSync_ = "sync-" TopicState = "state" TopicStore_ = "store" TopicUpdate = "update" )
View Source
const ( MessageHalt = iota MessageRestart MessageInterrupt MessagePause MessageResume MessageEnable MessageDisable MessageSyncLoop MessageResync MessageResyncDry MessagePublishState MessagePublishStore MessageRestartClean // Restart an clean snapshots MessageHaltClean // Halt task and remove all configs )
Variables ¶
This section is empty.
Functions ¶
func MessageFromString ¶
Types ¶
type CommandMessage ¶
type CommandMessage int
type HttpServer ¶
type HttpServer struct {
WebSocket *melody.Melody
LogSocket *melody.Melody
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer() *HttpServer
func (*HttpServer) InitHandlers ¶
func (h *HttpServer) InitHandlers()
func (*HttpServer) ListenStatus ¶
func (h *HttpServer) ListenStatus()
func (*HttpServer) Serve ¶
func (h *HttpServer) Serve()
func (*HttpServer) Stop ¶
func (h *HttpServer) Stop()
func (*HttpServer) Sync ¶
func (h *HttpServer) Sync() error
type MemoryStateStore ¶
func NewMemoryStateStore ¶
func NewMemoryStateStore(config *config.Task) *MemoryStateStore
func (*MemoryStateStore) BothConnected ¶
func (b *MemoryStateStore) BothConnected() bool
func (*MemoryStateStore) LastState ¶
func (b *MemoryStateStore) LastState() common.SyncState
func (*MemoryStateStore) TouchLastOpsTime ¶
func (b *MemoryStateStore) TouchLastOpsTime(t ...time.Time)
func (*MemoryStateStore) UpdateConnection ¶
func (b *MemoryStateStore) UpdateConnection(c bool, i model.EndpointInfo) common.SyncState
func (*MemoryStateStore) UpdateEndpointStats ¶
func (b *MemoryStateStore) UpdateEndpointStats(s *model.EndpointRootStat, i model.EndpointInfo) common.SyncState
func (*MemoryStateStore) UpdateProcessStatus ¶
func (b *MemoryStateStore) UpdateProcessStatus(processStatus model.Status, status ...model.TaskStatus) common.SyncState
func (*MemoryStateStore) UpdateSyncStatus ¶
func (b *MemoryStateStore) UpdateSyncStatus(s model.TaskStatus) common.SyncState
func (*MemoryStateStore) UpdateWatcherActivity ¶
func (b *MemoryStateStore) UpdateWatcherActivity(a bool, i model.EndpointInfo) common.SyncState
type PatchesRequest ¶
type PatchesResponse ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
type StateStore ¶
type StateStore interface {
LastState() common.SyncState
BothConnected() bool
TouchLastOpsTime(t ...time.Time)
UpdateConnection(c bool, i model.EndpointInfo) common.SyncState
UpdateWatcherActivity(a bool, i model.EndpointInfo) common.SyncState
UpdateEndpointStats(s *model.EndpointRootStat, i model.EndpointInfo) common.SyncState
UpdateSyncStatus(s model.TaskStatus) common.SyncState
UpdateProcessStatus(processStatus model.Status, status ...model.TaskStatus) common.SyncState
}
type Supervisor ¶
type Supervisor struct {
sync.Mutex
*suture.Supervisor
// contains filtered or unexported fields
}
Supervisor is a service manager for starting syncs and other services and restarting them if necessary
func (*Supervisor) Serve ¶
func (s *Supervisor) Serve() error
Serve starts all services and start listening to config and bus The call is blocking until all services are stopped
type TreeRequest ¶
type TreeResponse ¶
func (*TreeResponse) MarshalJSON ¶
func (l *TreeResponse) MarshalJSON() ([]byte, error)
func (*TreeResponse) ProtoMessage ¶
func (l *TreeResponse) ProtoMessage()
func (*TreeResponse) Reset ¶
func (l *TreeResponse) Reset()
func (*TreeResponse) String ¶
func (l *TreeResponse) String() string
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
func NewUpdater() *Updater
func (*Updater) ApplyUpdate ¶
ApplyUpdate uses the info of an update.Package to download the binary and replace the current running binary. A restart is necessary afterward. The dryRun option will download the binary and just put it in the /tmp folder
Click to show internal directories.
Click to hide internal directories.