masterapi

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShardingRoleNone         = "none"
	ShardingRoleShardServer  = "shardsvr"
	ShardingRoleConfigServer = "configsvr"
)

Variables

This section is empty.

Functions

func ModelExecutionStateToApiMongodState

func ModelExecutionStateToApiMongodState(e model.MongodExecutionState) msp.MongodState

func ProjectReplicaSetToModelReplicaSet

func ProjectReplicaSetToModelReplicaSet(r *ReplicaSet) (*model.ReplicaSet, error)

func ProjectRiskGroupToModelRiskGroup

func ProjectRiskGroupToModelRiskGroup(r *RiskGroup) (*model.RiskGroup, error)

func ProjectShardingRoleToModelShardingRole

func ProjectShardingRoleToModelShardingRole(api ShardingRole) (out model.ShardingRole, err error)

func ProjectSlaveToModelSlave

func ProjectSlaveToModelSlave(s *Slave) (*model.Slave, error)

func SlaveConfiguredStateTransitioning

func SlaveConfiguredStateTransitioning(tx *gorm.DB, s *model.Slave) (bool, error)

func SlaveJSONRepresentationToStruct

func SlaveJSONRepresentationToStruct(s string) (model.SlaveState, error)

func SlaveStateToJSONRepresentation

func SlaveStateToJSONRepresentation(s model.SlaveState) string

Types

type MasterAPI

type MasterAPI struct {
	DB               *model.DB
	ClusterAllocator *master.ClusterAllocator
	Router           *mux.Router
}

func (*MasterAPI) KeyfileGet

func (m *MasterAPI) KeyfileGet(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ManagementUserGet

func (m *MasterAPI) ManagementUserGet(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) MongodsByReplicaSet

func (m *MasterAPI) MongodsByReplicaSet(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) MongodsBySlave

func (m *MasterAPI) MongodsBySlave(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ProblemById

func (m *MasterAPI) ProblemById(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ProblemByReplicaSet

func (m *MasterAPI) ProblemByReplicaSet(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ProblemBySlave

func (m *MasterAPI) ProblemBySlave(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ProblemIndex

func (m *MasterAPI) ProblemIndex(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ReplicaSetById

func (m *MasterAPI) ReplicaSetById(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ReplicaSetDelete

func (m *MasterAPI) ReplicaSetDelete(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ReplicaSetGetSlaves

func (m *MasterAPI) ReplicaSetGetSlaves(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ReplicaSetIndex

func (m *MasterAPI) ReplicaSetIndex(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ReplicaSetPut

func (m *MasterAPI) ReplicaSetPut(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) ReplicaSetUpdate

func (m *MasterAPI) ReplicaSetUpdate(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupAssignSlave

func (m *MasterAPI) RiskGroupAssignSlave(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupById

func (m *MasterAPI) RiskGroupById(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupDelete

func (m *MasterAPI) RiskGroupDelete(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupGetSlaves

func (m *MasterAPI) RiskGroupGetSlaves(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupIndex

func (m *MasterAPI) RiskGroupIndex(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupPut

func (m *MasterAPI) RiskGroupPut(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupRemoveSlave

func (m *MasterAPI) RiskGroupRemoveSlave(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) RiskGroupUpdate

func (m *MasterAPI) RiskGroupUpdate(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) Setup

func (m *MasterAPI) Setup()

func (*MasterAPI) SlaveById

func (m *MasterAPI) SlaveById(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) SlaveDelete

func (m *MasterAPI) SlaveDelete(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) SlaveIndex

func (m *MasterAPI) SlaveIndex(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) SlavePut

func (m *MasterAPI) SlavePut(w http.ResponseWriter, r *http.Request)

func (*MasterAPI) SlaveUpdate

func (m *MasterAPI) SlaveUpdate(w http.ResponseWriter, r *http.Request)

type Mongod

type Mongod struct {
	ID                     int64  `json:"id"`
	Port                   uint   `json:"slave_port"`
	ReplicaSetID           int64  `json:"replica_set_id"`
	ParentSlaveID          int64  `json:"parent_slave_id"`
	ObservedExecutionState string `json:"observed_execution_state"`
}

func ProjectModelMongodToMongod

func ProjectModelMongodToMongod(m *model.Mongod) *Mongod

type MongodKeyfile

type MongodKeyfile struct {
	Content string `json:"content"`
}

func ProjectModelMongodKeyfileToAPIMongodKeyfile

func ProjectModelMongodKeyfileToAPIMongodKeyfile(m model.MongodKeyfile) (out MongodKeyfile)

type MongodbCredential

type MongodbCredential struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func ProjectModelMongodbCredentialToAPIMongodbCredential

func ProjectModelMongodbCredentialToAPIMongodbCredential(m model.MongodbCredential) (out MongodbCredential)

type Problem

type Problem struct {
	ID              int64     `json:"id"`
	Description     string    `json:"description"`
	LongDescription string    `json:"long_description"`
	FirstOccurred   time.Time `json:"first_occurred"`
	LastUpdated     time.Time `json:"last_updated"`
	SlaveId         *int64    `json:"slave_id"`
	ReplicaSetId    *int64    `json:"replica_set_id"`
}

func ProjectModelProblemToProblem

func ProjectModelProblemToProblem(m *model.Problem) *Problem

type ReplicaSet

type ReplicaSet struct {
	ID                  int64        `json:"id"`
	Name                string       `json:"name"`
	PersistentNodeCount uint         `json:"persistent_node_count"`
	VolatileNodeCount   uint         `json:"volatile_node_count"`
	ShardingRole        ShardingRole `json:"sharding_role"`
}

func ProjectModelReplicaSetToReplicaSet

func ProjectModelReplicaSetToReplicaSet(m *model.ReplicaSet) *ReplicaSet

type RiskGroup

type RiskGroup struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

func ProjectModelRiskGroupToRiskGroup

func ProjectModelRiskGroupToRiskGroup(m *model.RiskGroup) *RiskGroup

type ShardingRole

type ShardingRole string

func ProjectModelShardingRoleToShardingRole

func ProjectModelShardingRoleToShardingRole(modelRole model.ShardingRole) (out ShardingRole, err error)

type Slave

type Slave struct {
	ID                           int64  `json:"id"`
	Hostname                     string `json:"hostname"`
	Port                         uint   `json:"slave_port"`
	MongodPortRangeBegin         uint   `json:"mongod_port_range_begin"` //inclusive
	MongodPortRangeEnd           uint   `json:"mongod_port_range_end"`   //exclusive
	PersistentStorage            bool   `json:"persistent_storage"`
	ConfiguredState              string `json:"configured_state"`
	ConfiguredStateTransitioning bool   `json:"configured_state_transitioning"`
	RiskGroupID                  *int64 `json:"risk_group_id"`
}

func ProjectModelSlaveToSlave

func ProjectModelSlaveToSlave(tx *gorm.DB, m *model.Slave) (*Slave, error)

Jump to

Keyboard shortcuts

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