juju-cloudsigma: github.com/Altoros/juju-cloudsigma/worker/peergrouper Index | Files

package peergrouper

import "github.com/Altoros/juju-cloudsigma/worker/peergrouper"

Index

Package Files

desired.go initiate.go publish.go shim.go worker.go

Variables

var ErrReplicaSetAlreadyInitiated = errors.New("replicaset is already initiated")

ErrReplicaSetAlreadyInitiated is returned with attemptInitiateMongoServer is called on a mongo with an existing relicaset, it helps to assert which of the two valid paths was taking when calling MaybeInitiateMongoServer/InitiateMongoServer which is useful for testing purposes and also when debugging cases of faulty replica sets

func InitiateMongoServer Uses

func InitiateMongoServer(p InitiateMongoParams, force bool) error

InitiateMongoServer checks for an existing mongo configuration. If no existing configuration is found one is created using Initiate. If force flag is true, the configuration will be started anyway.

func MaybeInitiateMongoServer Uses

func MaybeInitiateMongoServer(p InitiateMongoParams) error

MaybeInitiateMongoServer is a convenience function for initiating a mongo replicaset only if it is not already initiated.

func New Uses

func New(st *state.State) (worker.Worker, error)

New returns a new worker that maintains the mongo replica set with respect to the given state.

type InitiateMongoParams Uses

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.

Package peergrouper imports 16 packages (graph). Updated 2016-08-02. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).