Documentation ¶
Index ¶
- Constants
- func NewBusyTable() *busyTable
- type ConcreteMongodConfigurator
- func (c *ConcreteMongodConfigurator) ApplyMongodConfiguration(m msp.Mongod) *msp.Error
- func (c *ConcreteMongodConfigurator) InitiateReplicaSet(m msp.RsInitiateMessage) *msp.Error
- func (c *ConcreteMongodConfigurator) MongodConfiguration(port msp.PortNumber, cred msp.MongodCredential) (msp.Mongod, *msp.Error)
- type Controller
- type MongodConfigurator
- type ProcessManager
- func (p *ProcessManager) CreateManagedDirs() (err error)
- func (p *ProcessManager) HasProcess(port msp.PortNumber) bool
- func (p *ProcessManager) KillProcess(port msp.PortNumber) error
- func (p *ProcessManager) KillProcesses() error
- func (p *ProcessManager) Run()
- func (p *ProcessManager) RunningProcesses() []msp.PortNumber
- func (p *ProcessManager) SpawnProcess(m msp.Mongod) (err error)
- func (p *ProcessManager) UpdateKeyfile(m msp.Mongod) (err error)
Constants ¶
View Source
const KeyfilePermissions = 0600
Variables ¶
This section is empty.
Functions ¶
func NewBusyTable ¶
func NewBusyTable() *busyTable
Types ¶
type ConcreteMongodConfigurator ¶
type ConcreteMongodConfigurator struct { MongodSoftShutdownTimeout time.Duration MongodResponseTimeout time.Duration }
func (*ConcreteMongodConfigurator) ApplyMongodConfiguration ¶
func (c *ConcreteMongodConfigurator) ApplyMongodConfiguration(m msp.Mongod) *msp.Error
func (*ConcreteMongodConfigurator) InitiateReplicaSet ¶
func (c *ConcreteMongodConfigurator) InitiateReplicaSet(m msp.RsInitiateMessage) *msp.Error
func (*ConcreteMongodConfigurator) MongodConfiguration ¶
func (c *ConcreteMongodConfigurator) MongodConfiguration(port msp.PortNumber, cred msp.MongodCredential) (msp.Mongod, *msp.Error)
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(processManager *ProcessManager, configurator MongodConfigurator, mongodHardShutdownTimeout time.Duration) *Controller
func (*Controller) EstablishMongodState ¶
func (c *Controller) EstablishMongodState(m msp.Mongod) *msp.Error
func (*Controller) RequestStatus ¶
func (c *Controller) RequestStatus() ([]msp.Mongod, *msp.Error)
func (*Controller) RsInitiate ¶
func (c *Controller) RsInitiate(m msp.RsInitiateMessage) *msp.Error
type MongodConfigurator ¶
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager(command string, dataDir string) *ProcessManager
func (*ProcessManager) CreateManagedDirs ¶
func (p *ProcessManager) CreateManagedDirs() (err error)
Create directories managed by ProcessManager returns nil if already exists and permissions are suitable
func (*ProcessManager) HasProcess ¶
func (p *ProcessManager) HasProcess(port msp.PortNumber) bool
func (*ProcessManager) KillProcess ¶
func (p *ProcessManager) KillProcess(port msp.PortNumber) error
func (*ProcessManager) KillProcesses ¶
func (p *ProcessManager) KillProcesses() error
killProcess is destructive. Even when there was an error (already killed, stuck state, permissions lost), we do not care. The error is purely informational that _something_ went wrong. This function is to be used for complete clean restart/shutdown only.
func (*ProcessManager) Run ¶
func (p *ProcessManager) Run()
func (*ProcessManager) RunningProcesses ¶
func (p *ProcessManager) RunningProcesses() []msp.PortNumber
func (*ProcessManager) SpawnProcess ¶
func (p *ProcessManager) SpawnProcess(m msp.Mongod) (err error)
Spawn a new Mongod process
The Mongod's `--keyfile` is only updated when it is spawned
func (*ProcessManager) UpdateKeyfile ¶
func (p *ProcessManager) UpdateKeyfile(m msp.Mongod) (err error)
Update or create the keyfile of a Mongod
Source Files ¶
Click to show internal directories.
Click to hide internal directories.