Documentation ¶
Index ¶
- Constants
- Variables
- type Cmd
- type Handler
- type Process
- func (p *Process) ConfigPath() string
- func (p *Process) DialInfo() *mgo.DialInfo
- func (p *Process) Info() (*client.DatabaseInfo, error)
- func (p *Process) Ready() <-chan state.DatabaseEvent
- func (p *Process) Reconfigure(config *state.Config) error
- func (p *Process) Start() error
- func (p *Process) Stop() error
- func (p *Process) XLog() xlog.XLog
- func (p *Process) XLogPosition() (xlog.Position, error)
Constants ¶
View Source
const ( DefaultHost = "127.0.0.1" DefaultPort = "27017" DefaultBinDir = "/usr/bin" DefaultDataDir = "/data" DefaultPassword = "" DefaultOpTimeout = 5 * time.Minute DefaultReplTimeout = 1 * time.Minute BinName = "mongod" ConfigName = "mongod.conf" )
View Source
const ( Startup replicaState = iota Primary Secondary Recovering Startup2 Unknown Arbiter Down Rollback Removed )
Variables ¶
View Source
var ( // ErrRunning is returned when starting an already running process. ErrRunning = errors.New("process already running") // ErrStopped is returned when stopping an already stopped process. ErrStopped = errors.New("process already stopped") ErrNoReplicationStatus = errors.New("no replication status") )
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
Cmd wraps exec.Cmd and provides helpers for checking for expected exits.
func (*Cmd) Err ¶
Err returns an error if cmd stopped unexpectedly. Must wait for the Stopped channel to return first.
type Handler ¶
type Handler struct { Process *Process Peer *state.Peer Heartbeater discoverd.Heartbeater Logger log15.Logger // contains filtered or unexported fields }
Handler represents an HTTP API handler for the process.
type Process ¶
type Process struct { ID string Singleton bool Host string Port string BinDir string DataDir string Password string ServerID uint32 OpTimeout time.Duration ReplTimeout time.Duration Logger log15.Logger // contains filtered or unexported fields }
Process represents a MongoDB process.
func (*Process) ConfigPath ¶
func (*Process) DialInfo ¶
func (p *Process) DialInfo() *mgo.DialInfo
DialInfo returns dial info for connecting to the local process as the "owo" user.
func (*Process) Ready ¶
func (p *Process) Ready() <-chan state.DatabaseEvent
Click to show internal directories.
Click to hide internal directories.