Versions in this module Expand all Collapse all v0 v0.1.0 Jun 4, 2023 Changes in this version + const Arbiter + const CmdOk + const CreateUser + const CreateUserNotMaster + const CreateUserSuccess + const CreateUserUnauthorized + const DBServerStatusReplMe + const DbAdmin + const DbLocal + const MaxMembers + const MongoClusterAdmin + const MongoClusterMonitor + const MongoDB + const MongoPassword + const MongoReadWrite + const MongoRole + const MongoRoot + const MongoShellEvalNoAuth + const MongoShellEvalWithAuth + const MongoUser + const OK + const Primary + const RSAlreadyInitialized + const RSConfigIncompatible + const RSIntitate + const RSReconfig + const RSStatus + const ReconfigUnauthorized + const Secondary + var ErrAlreadyExists = errors2.New("already exists") + var ErrCmdNotOk = errors2.New("command exec not ok") + var StaticMemberUtil = new(memberUtil) + type Client struct + func Dial(addrs []string, user, password string, direct bool) (*Client, error) + func (s *Client) AddMembers(members []Member) error + func (s *Client) ChangeUserPassword(name, pw string) error + func (s *Client) CheckMemberStatus() (error, []string, []string) + func (s *Client) CheckReplSetInit() error + func (s *Client) CreateUserBySecret(usersSecret *corev1.Secret) error + func (s *Client) CreateUserBySpec(user, pw string, roles primitive.A) error + func (s *Client) GetMgoNodeInfo() (*ServerStatusRepl, error) + func (s *Client) ReadConfig() (*RSConfig, error) + func (s *Client) RemoveMembers(members []Member) error + func (s *Client) ReplMemberStatus() ([]MemberStatus, error) + func (s *Client) RunCommand(cmd bson.D, pResult interface{}) error + func (s *Client) StepDown() error + func (s *Client) WriteConfig(cfg *RSConfig) error + func (s *Client) WriteConfigWithForce(cfg *RSConfig) error + type DBServerStatusReplResponse struct + OK int + ServerStatusRepl ServerStatusRepl + type Member struct + ArbiterOnly bool + BuildIndexes bool + Hidden bool + Host string + ID int + Priority int + SlaveDelay int64 + Tags ReplsetTags + Votes int + type MemberStatus struct + Health int + Host string + ID int + State int + StateStr string + SyncSourceHost string + SyncingTo string + type OKResponse struct + Errmsg string + OK int + type RSConfig struct + Configsvr bool + ID string + Members []Member + ProtocolVersion int + Settings Settings + Version int + WriteConcernMajorityJournalDefault bool + type RSConfigWrap struct + Config *RSConfig + Errmsg string + OK int + type RSStatusResponse struct + Members []MemberStatus + OK int + type ReplsetTags map[string]string + type ServerStatusRepl struct + ArbiterOnly bool + IsMaster bool + Me string + Primary string + Secondary bool + type Settings struct + CatchUpTimeoutMillis int64 + ChainingAllowed bool + ElectionTimeoutMillis int64 + GetLastErrorDefaults WriteConcern + GetLastErrorModes map[string]ReplsetTags + HeartbeatIntervalMillis int64 + HeartbeatTimeoutSecs int + ReplicaSetID primitive.ObjectID + type WriteConcern struct + Journal bool + WriteConcern interface{} + WriteTimeout int