msp

package
v0.0.0-...-67ae82b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2016 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	MongodStateForceDestroyed = "forcedestroyed"
	MongodStateDestroyed      = "destroyed"
	MongodStateNotRunning     = "notrunning"
	MongodStateUninitialized  = "uninitiated"
	MongodStateRecovering     = "recovering"
	MongodStateRunning        = "running"
	MongodStateRemoved        = "removed"
)
View Source
const BadStateDescription string = "BADSTATE"
View Source
const CommunicationError string = "COMM" // slave is unreachable or slave response not understood

List of Error identifiers

View Source
const NotImplementedError string = "NOTIMPLEMENTED"
View Source
const SlaveConnectMongodError string = "SLAVECONERR"
View Source
const SlaveGetMongodStatusError string = "SLAVEGETSTATUSERR"
View Source
const SlaveMongodProtocolError string = "SLAVEMONGODPROTOERR"
View Source
const SlaveReplicaSetConfigError string = "SLAVEREPLSETCONFIG"
View Source
const SlaveReplicaSetCreateRootUserError string = "SLAVEREPLSETCREATEROOTUSER"
View Source
const SlaveReplicaSetInitError string = "SLAVEREPLSETINIT"
View Source
const SlaveShutdownError string = "SLAVESHUTDOWNERR"
View Source
const SlaveSpawnError string = "SLAVESPAWN"

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	RequestStatus() ([]Mongod, *Error)
	EstablishMongodState(m Mongod) *Error
	RsInitiate(m RsInitiateMessage) *Error
}

type Error

type Error struct {
	// See constants in this package for list of identifiers
	Identifier      string
	Description     string
	LongDescription string
}

func (Error) String

func (e Error) String() string

type HostPort

type HostPort struct {
	Hostname string
	Port     PortNumber
}

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(listener Consumer, listenString string, caFile string, certFile string, keyFile string) *Listener

func (Listener) Run

func (s Listener) Run() error

type MSPClient

type MSPClient interface {
	RequestStatus(Target HostPort) ([]Mongod, *Error)
	InitiateReplicaSet(Target HostPort, msg RsInitiateMessage) *Error
	EstablishMongodState(Target HostPort, m Mongod) *Error
}

type MSPClientImpl

type MSPClientImpl struct {
	HttpClient http.Client
}

func (MSPClientImpl) EstablishMongodState

func (c MSPClientImpl) EstablishMongodState(target HostPort, m Mongod) *Error

func (MSPClientImpl) InitiateReplicaSet

func (c MSPClientImpl) InitiateReplicaSet(target HostPort, msg RsInitiateMessage) *Error

func (MSPClientImpl) RequestStatus

func (c MSPClientImpl) RequestStatus(Target HostPort) ([]Mongod, *Error)

type Mongod

type Mongod struct {
	Port                    PortNumber
	KeyfileContent          string
	ReplicaSetConfig        ReplicaSetConfig
	StatusError             *Error
	LastEstablishStateError *Error
	State                   MongodState
}

func (Mongod) GoString

func (m Mongod) GoString() string

type MongodCredential

type MongodCredential struct {
	Username, Password string
}

func (MongodCredential) GoString

func (m MongodCredential) GoString() string

type MongodState

type MongodState string

func (MongodState) IsProcessExecuting

func (s MongodState) IsProcessExecuting() bool

type PortNumber

type PortNumber uint16

type ReplicaSetConfig

type ReplicaSetConfig struct {
	ReplicaSetName    string
	ReplicaSetMembers []ReplicaSetMember
	ShardingRole      ShardingRole
	RootCredential    MongodCredential // user with the Superuse Role `root`, see https://docs.mongodb.com/manual/reference/built-in-roles/#root
}

type ReplicaSetMember

type ReplicaSetMember struct {
	HostPort HostPort
	Priority float64
	Votes    int
}

type RsInitiateMessage

type RsInitiateMessage struct {
	Port             PortNumber
	ReplicaSetConfig ReplicaSetConfig
}

type ShardingRole

type ShardingRole string
const (
	ShardingRoleNone         ShardingRole = "none"
	ShardingRoleShardServer  ShardingRole = "shardsvr"
	ShardingRoleConfigServer ShardingRole = "configsvr"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL