Documentation ¶
Index ¶
- func InitiateMongoServer(p InitiateMongoParams) error
- func Manifold(config ManifoldConfig) dependency.Manifold
- func New(config Config) (worker.Worker, error)
- type APIHostPortsSetter
- type CachingAPIHostPortsSetter
- type Config
- type Hub
- type InitiateMongoParams
- type Machine
- type ManifoldConfig
- type MongoSession
- type MongoSessionShim
- type Space
- type State
- type StateShim
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitiateMongoServer ¶
func InitiateMongoServer(p InitiateMongoParams) error
InitiateMongoServer checks for an existing mongo configuration. If no existing configuration is found one is created using Initiate.
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency.Manifold that will run a peergrouper.
Types ¶
type APIHostPortsSetter ¶
type CachingAPIHostPortsSetter ¶
type CachingAPIHostPortsSetter struct { APIHostPortsSetter // contains filtered or unexported fields }
CachingAPIHostPortsSetter is an APIHostPortsSetter that caches the most recently set values, suppressing further calls to the underlying setter if any call's arguments match those of the preceding call.
func (*CachingAPIHostPortsSetter) SetAPIHostPorts ¶
func (s *CachingAPIHostPortsSetter) SetAPIHostPorts(apiServers [][]network.HostPort) error
type Config ¶
type Config struct { State State APIHostPortsSetter APIHostPortsSetter MongoSession MongoSession Clock clock.Clock SupportsSpaces bool MongoPort int APIPort int ControllerAPIPort int // Hub is the central hub of the apiserver, // and is used to publish the details of the // API servers. Hub Hub }
Config holds the configuration for a peergrouper worker.
type Hub ¶
type Hub interface { Subscribe(topic string, handler interface{}) (func(), error) Publish(topic string, data interface{}) (<-chan struct{}, error) }
Hub defines the methods of the apiserver centralhub that the peer grouper uses.
type InitiateMongoParams ¶
type InitiateMongoParams struct { // DialInfo specifies how to connect to the mongo server. DialInfo *mgo.DialInfo // MemberHostPort provides the address to use for // the first replica set member. MemberHostPort string // User holds the user to log as in to the mongo server. // If it is empty, no login will take place. User string Password string }
InitiateMongoParams holds parameters for the MaybeInitiateMongo call.
type ManifoldConfig ¶
type ManifoldConfig struct { AgentName string ClockName string ControllerPortName string StateName string Hub Hub NewWorker func(Config) (worker.Worker, error) ControllerSupportsSpaces func(*state.State) (bool, error) }
ManifoldConfig holds the information necessary to run a peergrouper in a dependency.Engine.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate validates the manifold configuration.
type MongoSession ¶
type MongoSession interface { CurrentStatus() (*replicaset.Status, error) CurrentMembers() ([]replicaset.Member, error) Set([]replicaset.Member) error StepDownPrimary() error Refresh() }
type MongoSessionShim ¶
type MongoSessionShim struct {
*mgo.Session
}
MongoSessionShim wraps a *mgo.Session to conform to the MongoSession interface.
func (MongoSessionShim) CurrentMembers ¶
func (s MongoSessionShim) CurrentMembers() ([]replicaset.Member, error)
func (MongoSessionShim) CurrentStatus ¶
func (s MongoSessionShim) CurrentStatus() (*replicaset.Status, error)
func (MongoSessionShim) Refresh ¶
func (s MongoSessionShim) Refresh()
func (MongoSessionShim) Set ¶
func (s MongoSessionShim) Set(members []replicaset.Member) error
func (MongoSessionShim) StepDownPrimary ¶
func (s MongoSessionShim) StepDownPrimary() error
type State ¶
type State interface { RemoveControllerMachine(m Machine) error ControllerConfig() (controller.Config, error) ControllerInfo() (*state.ControllerInfo, error) Machine(id string) (Machine, error) WatchControllerInfo() state.NotifyWatcher WatchControllerStatusChanges() state.StringsWatcher WatchControllerConfig() state.NotifyWatcher }