Documentation ¶
Overview ¶
Package engines is a generated GoMock package.
Index ¶
- Constants
- Variables
- func BuildExample(info *ConnectionInfo, client string, ...) string
- func GetIndex(memberName string) (int, error)
- func MaxInt64(x, y int64) int64
- type AuthInfo
- type BuildConnectExample
- type ClusterCommands
- type ConnectionInfo
- type DBManager
- type DBManagerBase
- func (mgr *DBManagerBase) CreateRoot(context.Context) error
- func (mgr *DBManagerBase) CreateUser(context.Context, string, string) error
- func (mgr *DBManagerBase) DeleteUser(context.Context, string) error
- func (mgr *DBManagerBase) Demote(context.Context) error
- func (mgr *DBManagerBase) DescribeUser(context.Context, string) (*models.UserInfo, error)
- func (mgr *DBManagerBase) Exec(context.Context, string) (int64, error)
- func (mgr *DBManagerBase) Follow(context.Context, *dcs.Cluster) error
- func (mgr *DBManagerBase) GetCurrentMemberName() string
- func (mgr *DBManagerBase) GetDBState(context.Context, *dcs.Cluster) *dcs.DBState
- func (mgr *DBManagerBase) GetLag(context.Context, *dcs.Cluster) (int64, error)
- func (mgr *DBManagerBase) GetLogger() logr.Logger
- func (mgr *DBManagerBase) GetMemberAddrs(context.Context, *dcs.Cluster) []string
- func (mgr *DBManagerBase) GetPort() (int, error)
- func (mgr *DBManagerBase) GetReplicaRole(context.Context, *dcs.Cluster) (string, error)
- func (mgr *DBManagerBase) GrantUserRole(context.Context, string, string) error
- func (mgr *DBManagerBase) HasOtherHealthyLeader(context.Context, *dcs.Cluster) *dcs.Member
- func (mgr *DBManagerBase) HasOtherHealthyMembers(context.Context, *dcs.Cluster, string) []*dcs.Member
- func (mgr *DBManagerBase) InitializeCluster(context.Context, *dcs.Cluster) error
- func (mgr *DBManagerBase) IsClusterHealthy(context.Context, *dcs.Cluster) bool
- func (mgr *DBManagerBase) IsClusterInitialized(context.Context, *dcs.Cluster) (bool, error)
- func (mgr *DBManagerBase) IsCurrentMemberHealthy(context.Context, *dcs.Cluster) bool
- func (mgr *DBManagerBase) IsCurrentMemberInCluster(context.Context, *dcs.Cluster) bool
- func (mgr *DBManagerBase) IsDBStartupReady() bool
- func (mgr *DBManagerBase) IsFirstMember() bool
- func (mgr *DBManagerBase) IsLeader(context.Context, *dcs.Cluster) (bool, error)
- func (mgr *DBManagerBase) IsLeaderMember(context.Context, *dcs.Cluster, *dcs.Member) (bool, error)
- func (mgr *DBManagerBase) IsMemberHealthy(context.Context, *dcs.Cluster, *dcs.Member) bool
- func (mgr *DBManagerBase) IsMemberLagging(context.Context, *dcs.Cluster, *dcs.Member) (bool, int64)
- func (mgr *DBManagerBase) IsPromoted(context.Context) bool
- func (mgr *DBManagerBase) IsRootCreated(context.Context) (bool, error)
- func (mgr *DBManagerBase) IsRunning() bool
- func (mgr *DBManagerBase) JoinCurrentMemberToCluster(context.Context, *dcs.Cluster) error
- func (mgr *DBManagerBase) LeaveMemberFromCluster(context.Context, *dcs.Cluster, string) error
- func (mgr *DBManagerBase) ListSystemAccounts(context.Context) ([]models.UserInfo, error)
- func (mgr *DBManagerBase) ListUsers(context.Context) ([]models.UserInfo, error)
- func (mgr *DBManagerBase) Lock(context.Context, string) error
- func (mgr *DBManagerBase) MoveData(context.Context, *dcs.Cluster) error
- func (mgr *DBManagerBase) Promote(context.Context, *dcs.Cluster) error
- func (mgr *DBManagerBase) Query(context.Context, string) ([]byte, error)
- func (mgr *DBManagerBase) Recover(context.Context) error
- func (mgr *DBManagerBase) RevokeUserRole(context.Context, string, string) error
- func (mgr *DBManagerBase) SetLogger(logger logr.Logger)
- func (mgr *DBManagerBase) ShutDownWithWait()
- func (mgr *DBManagerBase) Start(context.Context, *dcs.Cluster) error
- func (mgr *DBManagerBase) Stop() error
- func (mgr *DBManagerBase) Unlock(context.Context) error
- type EngineInfo
- type MockDBManager
- func (m *MockDBManager) CreateRoot(arg0 context.Context) error
- func (m *MockDBManager) CreateUser(arg0 context.Context, arg1, arg2 string) error
- func (m *MockDBManager) DeleteUser(arg0 context.Context, arg1 string) error
- func (m *MockDBManager) Demote(arg0 context.Context) error
- func (m *MockDBManager) DescribeUser(arg0 context.Context, arg1 string) (*models.UserInfo, error)
- func (m *MockDBManager) EXPECT() *MockDBManagerMockRecorder
- func (m *MockDBManager) Exec(arg0 context.Context, arg1 string) (int64, error)
- func (m *MockDBManager) Follow(arg0 context.Context, arg1 *dcs.Cluster) error
- func (m *MockDBManager) GetCurrentMemberName() string
- func (m *MockDBManager) GetDBState(arg0 context.Context, arg1 *dcs.Cluster) *dcs.DBState
- func (m *MockDBManager) GetHealthiestMember(arg0 *dcs.Cluster, arg1 string) *dcs.Member
- func (m *MockDBManager) GetLag(arg0 context.Context, arg1 *dcs.Cluster) (int64, error)
- func (m *MockDBManager) GetLogger() logr.Logger
- func (m *MockDBManager) GetMemberAddrs(arg0 context.Context, arg1 *dcs.Cluster) []string
- func (m *MockDBManager) GetPort() (int, error)
- func (m *MockDBManager) GetReplicaRole(arg0 context.Context, arg1 *dcs.Cluster) (string, error)
- func (m *MockDBManager) GrantUserRole(arg0 context.Context, arg1, arg2 string) error
- func (m *MockDBManager) HasOtherHealthyLeader(arg0 context.Context, arg1 *dcs.Cluster) *dcs.Member
- func (m *MockDBManager) HasOtherHealthyMembers(arg0 context.Context, arg1 *dcs.Cluster, arg2 string) []*dcs.Member
- func (m *MockDBManager) InitializeCluster(arg0 context.Context, arg1 *dcs.Cluster) error
- func (m *MockDBManager) IsClusterHealthy(arg0 context.Context, arg1 *dcs.Cluster) bool
- func (m *MockDBManager) IsClusterInitialized(arg0 context.Context, arg1 *dcs.Cluster) (bool, error)
- func (m *MockDBManager) IsCurrentMemberHealthy(arg0 context.Context, arg1 *dcs.Cluster) bool
- func (m *MockDBManager) IsCurrentMemberInCluster(arg0 context.Context, arg1 *dcs.Cluster) bool
- func (m *MockDBManager) IsDBStartupReady() bool
- func (m *MockDBManager) IsFirstMember() bool
- func (m *MockDBManager) IsLeader(arg0 context.Context, arg1 *dcs.Cluster) (bool, error)
- func (m *MockDBManager) IsLeaderMember(arg0 context.Context, arg1 *dcs.Cluster, arg2 *dcs.Member) (bool, error)
- func (m *MockDBManager) IsMemberHealthy(arg0 context.Context, arg1 *dcs.Cluster, arg2 *dcs.Member) bool
- func (m *MockDBManager) IsMemberLagging(arg0 context.Context, arg1 *dcs.Cluster, arg2 *dcs.Member) (bool, int64)
- func (m *MockDBManager) IsPromoted(arg0 context.Context) bool
- func (m *MockDBManager) IsRootCreated(arg0 context.Context) (bool, error)
- func (m *MockDBManager) IsRunning() bool
- func (m *MockDBManager) JoinCurrentMemberToCluster(arg0 context.Context, arg1 *dcs.Cluster) error
- func (m *MockDBManager) LeaveMemberFromCluster(arg0 context.Context, arg1 *dcs.Cluster, arg2 string) error
- func (m *MockDBManager) ListSystemAccounts(arg0 context.Context) ([]models.UserInfo, error)
- func (m *MockDBManager) ListUsers(arg0 context.Context) ([]models.UserInfo, error)
- func (m *MockDBManager) Lock(arg0 context.Context, arg1 string) error
- func (m *MockDBManager) MoveData(arg0 context.Context, arg1 *dcs.Cluster) error
- func (m *MockDBManager) Promote(arg0 context.Context, arg1 *dcs.Cluster) error
- func (m *MockDBManager) Query(arg0 context.Context, arg1 string) ([]byte, error)
- func (m *MockDBManager) Recover(arg0 context.Context) error
- func (m *MockDBManager) RevokeUserRole(arg0 context.Context, arg1, arg2 string) error
- func (m *MockDBManager) ShutDownWithWait()
- func (m *MockDBManager) Start(arg0 context.Context, arg1 *dcs.Cluster) error
- func (m *MockDBManager) Stop() error
- func (m *MockDBManager) Unlock(arg0 context.Context) error
- type MockDBManagerMockRecorder
- func (mr *MockDBManagerMockRecorder) CreateRoot(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) CreateUser(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) DeleteUser(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Demote(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) DescribeUser(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Follow(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetCurrentMemberName() *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetDBState(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetHealthiestMember(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetLag(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetLogger() *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetMemberAddrs(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetPort() *gomock.Call
- func (mr *MockDBManagerMockRecorder) GetReplicaRole(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) GrantUserRole(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) HasOtherHealthyLeader(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) HasOtherHealthyMembers(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) InitializeCluster(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsClusterHealthy(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsClusterInitialized(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsCurrentMemberHealthy(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsCurrentMemberInCluster(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsDBStartupReady() *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsFirstMember() *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsLeader(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsLeaderMember(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsMemberHealthy(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsMemberLagging(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsPromoted(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsRootCreated(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) IsRunning() *gomock.Call
- func (mr *MockDBManagerMockRecorder) JoinCurrentMemberToCluster(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) LeaveMemberFromCluster(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) ListSystemAccounts(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) ListUsers(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Lock(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) MoveData(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Promote(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Query(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Recover(arg0 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) RevokeUserRole(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) ShutDownWithWait() *gomock.Call
- func (mr *MockDBManagerMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBManagerMockRecorder) Stop() *gomock.Call
- func (mr *MockDBManagerMockRecorder) Unlock(arg0 interface{}) *gomock.Call
- type MockManager
- func (*MockManager) CreateRoot(context.Context) error
- func (*MockManager) Demote(context.Context) error
- func (*MockManager) Follow(context.Context, *dcs.Cluster) error
- func (*MockManager) GetHealthiestMember(*dcs.Cluster, string) *dcs.Member
- func (*MockManager) GetMemberAddrs(context.Context, *dcs.Cluster) []string
- func (*MockManager) HasOtherHealthyLeader(context.Context, *dcs.Cluster) *dcs.Member
- func (*MockManager) HasOtherHealthyMembers(context.Context, *dcs.Cluster, string) []*dcs.Member
- func (*MockManager) InitializeCluster(context.Context, *dcs.Cluster) error
- func (*MockManager) IsClusterHealthy(context.Context, *dcs.Cluster) bool
- func (*MockManager) IsClusterInitialized(context.Context, *dcs.Cluster) (bool, error)
- func (*MockManager) IsCurrentMemberHealthy(context.Context, *dcs.Cluster) bool
- func (*MockManager) IsCurrentMemberInCluster(context.Context, *dcs.Cluster) bool
- func (*MockManager) IsDBStartupReady() bool
- func (*MockManager) IsFirstMember() bool
- func (*MockManager) IsLeader(context.Context, *dcs.Cluster) (bool, error)
- func (*MockManager) IsLeaderMember(context.Context, *dcs.Cluster, *dcs.Member) (bool, error)
- func (*MockManager) IsMemberHealthy(context.Context, *dcs.Cluster, *dcs.Member) bool
- func (*MockManager) IsPromoted(context.Context) bool
- func (*MockManager) IsRootCreated(context.Context) (bool, error)
- func (*MockManager) IsRunning() bool
- func (*MockManager) JoinCurrentMemberToCluster(context.Context, *dcs.Cluster) error
- func (*MockManager) LeaveMemberFromCluster(context.Context, *dcs.Cluster, string) error
- func (*MockManager) Lock(context.Context, string) error
- func (*MockManager) Promote(context.Context, *dcs.Cluster) error
- func (*MockManager) Recover(context.Context) error
- func (*MockManager) Unlock(context.Context) error
- type NewCommandFunc
- type Properties
Constants ¶
const ( HOST = "host" PORT = "port" USER = "user" PASSWORD = "password" COMMAND = "command" )
const ( // types for probe CheckRunningType int = iota CheckStatusType CheckRoleChangedType )
Variables ¶
var ( EnvVarMap = map[string]string{ HOST: "KB_HOST", PORT: "KB_PORT", USER: "KB_USER", PASSWORD: "KB_PASSWD", } NewCommandFuncs = map[string]NewCommandFunc{} )
Functions ¶
func BuildExample ¶
func BuildExample(info *ConnectionInfo, client string, examples map[models.ClientType]BuildConnectExample) string
Types ¶
type BuildConnectExample ¶
type BuildConnectExample func(info *ConnectionInfo) string
type ClusterCommands ¶
type ConnectionInfo ¶
type DBManager ¶
type DBManager interface { IsRunning() bool IsDBStartupReady() bool // Functions related to cluster initialization. InitializeCluster(context.Context, *dcs.Cluster) error IsClusterInitialized(context.Context, *dcs.Cluster) (bool, error) // IsCurrentMemberInCluster checks if current member is configured in cluster for consensus. // it will always return true for replicationset. IsCurrentMemberInCluster(context.Context, *dcs.Cluster) bool // IsClusterHealthy is only for consensus cluster healthy check. // For Replication cluster IsClusterHealthy will always return true, // and its cluster's healthy is equal to leader member's healthy. IsClusterHealthy(context.Context, *dcs.Cluster) bool // Member healthy check // IsMemberHealthy focuses on the database's read and write capabilities. IsMemberHealthy(context.Context, *dcs.Cluster, *dcs.Member) bool IsCurrentMemberHealthy(context.Context, *dcs.Cluster) bool // IsMemberLagging focuses on the latency between the leader and standby IsMemberLagging(context.Context, *dcs.Cluster, *dcs.Member) (bool, int64) GetLag(context.Context, *dcs.Cluster) (int64, error) // GetDBState will get most required database kernel states of current member in one HA loop to Avoiding duplicate queries and conserve I/O. // We believe that the states of database kernel remains unchanged within a single HA loop. GetDBState(context.Context, *dcs.Cluster) *dcs.DBState // HasOtherHealthyLeader is applicable only to consensus cluster, // where the db's internal role services as the source of truth. // for replicationset cluster, HasOtherHealthyLeader will always be nil. HasOtherHealthyLeader(context.Context, *dcs.Cluster) *dcs.Member HasOtherHealthyMembers(context.Context, *dcs.Cluster, string) []*dcs.Member // Functions related to replica member relationship. IsLeader(context.Context, *dcs.Cluster) (bool, error) IsLeaderMember(context.Context, *dcs.Cluster, *dcs.Member) (bool, error) IsFirstMember() bool GetReplicaRole(context.Context, *dcs.Cluster) (string, error) JoinCurrentMemberToCluster(context.Context, *dcs.Cluster) error LeaveMemberFromCluster(context.Context, *dcs.Cluster, string) error // IsPromoted is applicable only to consensus cluster, which is used to // check if DB has complete switchover. // for replicationset cluster, it will always be true. IsPromoted(context.Context) bool // Functions related to HA // The functions should be idempotent, indicating that if they have been executed in one ha cycle, // any subsequent calls during that cycle will have no effect. Promote(context.Context, *dcs.Cluster) error Demote(context.Context) error Follow(context.Context, *dcs.Cluster) error Recover(context.Context) error // Start and Stop just send signal to lorryctl Start(context.Context, *dcs.Cluster) error Stop() error GetCurrentMemberName() string GetMemberAddrs(context.Context, *dcs.Cluster) []string // Functions related to account manage IsRootCreated(context.Context) (bool, error) CreateRoot(context.Context) error // Readonly lock for disk full Lock(context.Context, string) error Unlock(context.Context) error // sql query Exec(context.Context, string) (int64, error) Query(context.Context, string) ([]byte, error) // user management ListUsers(context.Context) ([]models.UserInfo, error) ListSystemAccounts(context.Context) ([]models.UserInfo, error) CreateUser(context.Context, string, string) error DeleteUser(context.Context, string) error DescribeUser(context.Context, string) (*models.UserInfo, error) GrantUserRole(context.Context, string, string) error RevokeUserRole(context.Context, string, string) error GetPort() (int, error) MoveData(context.Context, *dcs.Cluster) error GetLogger() logr.Logger ShutDownWithWait() }
func NewMockManager ¶
func NewMockManager(properties Properties) (DBManager, error)
type DBManagerBase ¶
type DBManagerBase struct { CurrentMemberName string ClusterCompName string Namespace string DataDir string Logger logr.Logger DBStartupReady bool IsLocked bool DBState *dcs.DBState }
func NewDBManagerBase ¶
func NewDBManagerBase(logger logr.Logger) (*DBManagerBase, error)
func (*DBManagerBase) CreateRoot ¶
func (mgr *DBManagerBase) CreateRoot(context.Context) error
func (*DBManagerBase) CreateUser ¶
func (*DBManagerBase) DeleteUser ¶
func (mgr *DBManagerBase) DeleteUser(context.Context, string) error
func (*DBManagerBase) DescribeUser ¶
func (*DBManagerBase) GetCurrentMemberName ¶
func (mgr *DBManagerBase) GetCurrentMemberName() string
func (*DBManagerBase) GetDBState ¶
func (*DBManagerBase) GetLogger ¶
func (mgr *DBManagerBase) GetLogger() logr.Logger
func (*DBManagerBase) GetMemberAddrs ¶
func (*DBManagerBase) GetPort ¶
func (mgr *DBManagerBase) GetPort() (int, error)
func (*DBManagerBase) GetReplicaRole ¶
func (*DBManagerBase) GrantUserRole ¶
func (*DBManagerBase) HasOtherHealthyLeader ¶
func (*DBManagerBase) HasOtherHealthyMembers ¶
func (*DBManagerBase) InitializeCluster ¶
func (*DBManagerBase) IsClusterHealthy ¶
func (*DBManagerBase) IsClusterInitialized ¶
func (*DBManagerBase) IsCurrentMemberHealthy ¶
func (*DBManagerBase) IsCurrentMemberInCluster ¶
func (*DBManagerBase) IsDBStartupReady ¶
func (mgr *DBManagerBase) IsDBStartupReady() bool
func (*DBManagerBase) IsFirstMember ¶
func (mgr *DBManagerBase) IsFirstMember() bool
func (*DBManagerBase) IsLeaderMember ¶
func (*DBManagerBase) IsMemberHealthy ¶
func (*DBManagerBase) IsMemberLagging ¶
func (*DBManagerBase) IsPromoted ¶
func (mgr *DBManagerBase) IsPromoted(context.Context) bool
func (*DBManagerBase) IsRootCreated ¶
func (mgr *DBManagerBase) IsRootCreated(context.Context) (bool, error)
func (*DBManagerBase) IsRunning ¶
func (mgr *DBManagerBase) IsRunning() bool
func (*DBManagerBase) JoinCurrentMemberToCluster ¶
func (*DBManagerBase) LeaveMemberFromCluster ¶
func (*DBManagerBase) ListSystemAccounts ¶
func (*DBManagerBase) RevokeUserRole ¶
func (*DBManagerBase) SetLogger ¶
func (mgr *DBManagerBase) SetLogger(logger logr.Logger)
func (*DBManagerBase) ShutDownWithWait ¶
func (mgr *DBManagerBase) ShutDownWithWait()
func (*DBManagerBase) Stop ¶
func (mgr *DBManagerBase) Stop() error
type EngineInfo ¶
type MockDBManager ¶
type MockDBManager struct {
// contains filtered or unexported fields
}
MockDBManager is a mock of DBManager interface.
func NewMockDBManager ¶
func NewMockDBManager(ctrl *gomock.Controller) *MockDBManager
NewMockDBManager creates a new mock instance.
func (*MockDBManager) CreateRoot ¶
func (m *MockDBManager) CreateRoot(arg0 context.Context) error
CreateRoot mocks base method.
func (*MockDBManager) CreateUser ¶
func (m *MockDBManager) CreateUser(arg0 context.Context, arg1, arg2 string) error
CreateUser mocks base method.
func (*MockDBManager) DeleteUser ¶
func (m *MockDBManager) DeleteUser(arg0 context.Context, arg1 string) error
DeleteUser mocks base method.
func (*MockDBManager) Demote ¶
func (m *MockDBManager) Demote(arg0 context.Context) error
Demote mocks base method.
func (*MockDBManager) DescribeUser ¶
DescribeUser mocks base method.
func (*MockDBManager) EXPECT ¶
func (m *MockDBManager) EXPECT() *MockDBManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDBManager) GetCurrentMemberName ¶
func (m *MockDBManager) GetCurrentMemberName() string
GetCurrentMemberName mocks base method.
func (*MockDBManager) GetDBState ¶
GetDBState mocks base method.
func (*MockDBManager) GetHealthiestMember ¶
GetHealthiestMember mocks base method.
func (*MockDBManager) GetLogger ¶
func (m *MockDBManager) GetLogger() logr.Logger
GetLogger mocks base method.
func (*MockDBManager) GetMemberAddrs ¶
GetMemberAddrs mocks base method.
func (*MockDBManager) GetPort ¶
func (m *MockDBManager) GetPort() (int, error)
GetPort mocks base method.
func (*MockDBManager) GetReplicaRole ¶
GetReplicaRole mocks base method.
func (*MockDBManager) GrantUserRole ¶
func (m *MockDBManager) GrantUserRole(arg0 context.Context, arg1, arg2 string) error
GrantUserRole mocks base method.
func (*MockDBManager) HasOtherHealthyLeader ¶
HasOtherHealthyLeader mocks base method.
func (*MockDBManager) HasOtherHealthyMembers ¶
func (m *MockDBManager) HasOtherHealthyMembers(arg0 context.Context, arg1 *dcs.Cluster, arg2 string) []*dcs.Member
HasOtherHealthyMembers mocks base method.
func (*MockDBManager) InitializeCluster ¶
InitializeCluster mocks base method.
func (*MockDBManager) IsClusterHealthy ¶
IsClusterHealthy mocks base method.
func (*MockDBManager) IsClusterInitialized ¶
IsClusterInitialized mocks base method.
func (*MockDBManager) IsCurrentMemberHealthy ¶
IsCurrentMemberHealthy mocks base method.
func (*MockDBManager) IsCurrentMemberInCluster ¶
IsCurrentMemberInCluster mocks base method.
func (*MockDBManager) IsDBStartupReady ¶
func (m *MockDBManager) IsDBStartupReady() bool
IsDBStartupReady mocks base method.
func (*MockDBManager) IsFirstMember ¶
func (m *MockDBManager) IsFirstMember() bool
IsFirstMember mocks base method.
func (*MockDBManager) IsLeaderMember ¶
func (m *MockDBManager) IsLeaderMember(arg0 context.Context, arg1 *dcs.Cluster, arg2 *dcs.Member) (bool, error)
IsLeaderMember mocks base method.
func (*MockDBManager) IsMemberHealthy ¶
func (m *MockDBManager) IsMemberHealthy(arg0 context.Context, arg1 *dcs.Cluster, arg2 *dcs.Member) bool
IsMemberHealthy mocks base method.
func (*MockDBManager) IsMemberLagging ¶
func (m *MockDBManager) IsMemberLagging(arg0 context.Context, arg1 *dcs.Cluster, arg2 *dcs.Member) (bool, int64)
IsMemberLagging mocks base method.
func (*MockDBManager) IsPromoted ¶
func (m *MockDBManager) IsPromoted(arg0 context.Context) bool
IsPromoted mocks base method.
func (*MockDBManager) IsRootCreated ¶
func (m *MockDBManager) IsRootCreated(arg0 context.Context) (bool, error)
IsRootCreated mocks base method.
func (*MockDBManager) IsRunning ¶
func (m *MockDBManager) IsRunning() bool
IsRunning mocks base method.
func (*MockDBManager) JoinCurrentMemberToCluster ¶
JoinCurrentMemberToCluster mocks base method.
func (*MockDBManager) LeaveMemberFromCluster ¶
func (m *MockDBManager) LeaveMemberFromCluster(arg0 context.Context, arg1 *dcs.Cluster, arg2 string) error
LeaveMemberFromCluster mocks base method.
func (*MockDBManager) ListSystemAccounts ¶
ListSystemAccounts mocks base method.
func (*MockDBManager) Lock ¶
func (m *MockDBManager) Lock(arg0 context.Context, arg1 string) error
Lock mocks base method.
func (*MockDBManager) Recover ¶
func (m *MockDBManager) Recover(arg0 context.Context) error
Recover mocks base method.
func (*MockDBManager) RevokeUserRole ¶
func (m *MockDBManager) RevokeUserRole(arg0 context.Context, arg1, arg2 string) error
RevokeUserRole mocks base method.
func (*MockDBManager) ShutDownWithWait ¶
func (m *MockDBManager) ShutDownWithWait()
ShutDownWithWait mocks base method.
type MockDBManagerMockRecorder ¶
type MockDBManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockDBManagerMockRecorder is the mock recorder for MockDBManager.
func (*MockDBManagerMockRecorder) CreateRoot ¶
func (mr *MockDBManagerMockRecorder) CreateRoot(arg0 interface{}) *gomock.Call
CreateRoot indicates an expected call of CreateRoot.
func (*MockDBManagerMockRecorder) CreateUser ¶
func (mr *MockDBManagerMockRecorder) CreateUser(arg0, arg1, arg2 interface{}) *gomock.Call
CreateUser indicates an expected call of CreateUser.
func (*MockDBManagerMockRecorder) DeleteUser ¶
func (mr *MockDBManagerMockRecorder) DeleteUser(arg0, arg1 interface{}) *gomock.Call
DeleteUser indicates an expected call of DeleteUser.
func (*MockDBManagerMockRecorder) Demote ¶
func (mr *MockDBManagerMockRecorder) Demote(arg0 interface{}) *gomock.Call
Demote indicates an expected call of Demote.
func (*MockDBManagerMockRecorder) DescribeUser ¶
func (mr *MockDBManagerMockRecorder) DescribeUser(arg0, arg1 interface{}) *gomock.Call
DescribeUser indicates an expected call of DescribeUser.
func (*MockDBManagerMockRecorder) Exec ¶
func (mr *MockDBManagerMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call
Exec indicates an expected call of Exec.
func (*MockDBManagerMockRecorder) Follow ¶
func (mr *MockDBManagerMockRecorder) Follow(arg0, arg1 interface{}) *gomock.Call
Follow indicates an expected call of Follow.
func (*MockDBManagerMockRecorder) GetCurrentMemberName ¶
func (mr *MockDBManagerMockRecorder) GetCurrentMemberName() *gomock.Call
GetCurrentMemberName indicates an expected call of GetCurrentMemberName.
func (*MockDBManagerMockRecorder) GetDBState ¶
func (mr *MockDBManagerMockRecorder) GetDBState(arg0, arg1 interface{}) *gomock.Call
GetDBState indicates an expected call of GetDBState.
func (*MockDBManagerMockRecorder) GetHealthiestMember ¶
func (mr *MockDBManagerMockRecorder) GetHealthiestMember(arg0, arg1 interface{}) *gomock.Call
GetHealthiestMember indicates an expected call of GetHealthiestMember.
func (*MockDBManagerMockRecorder) GetLag ¶
func (mr *MockDBManagerMockRecorder) GetLag(arg0, arg1 interface{}) *gomock.Call
GetLag indicates an expected call of GetLag.
func (*MockDBManagerMockRecorder) GetLogger ¶
func (mr *MockDBManagerMockRecorder) GetLogger() *gomock.Call
GetLogger indicates an expected call of GetLogger.
func (*MockDBManagerMockRecorder) GetMemberAddrs ¶
func (mr *MockDBManagerMockRecorder) GetMemberAddrs(arg0, arg1 interface{}) *gomock.Call
GetMemberAddrs indicates an expected call of GetMemberAddrs.
func (*MockDBManagerMockRecorder) GetPort ¶
func (mr *MockDBManagerMockRecorder) GetPort() *gomock.Call
GetPort indicates an expected call of GetPort.
func (*MockDBManagerMockRecorder) GetReplicaRole ¶
func (mr *MockDBManagerMockRecorder) GetReplicaRole(arg0, arg1 interface{}) *gomock.Call
GetReplicaRole indicates an expected call of GetReplicaRole.
func (*MockDBManagerMockRecorder) GrantUserRole ¶
func (mr *MockDBManagerMockRecorder) GrantUserRole(arg0, arg1, arg2 interface{}) *gomock.Call
GrantUserRole indicates an expected call of GrantUserRole.
func (*MockDBManagerMockRecorder) HasOtherHealthyLeader ¶
func (mr *MockDBManagerMockRecorder) HasOtherHealthyLeader(arg0, arg1 interface{}) *gomock.Call
HasOtherHealthyLeader indicates an expected call of HasOtherHealthyLeader.
func (*MockDBManagerMockRecorder) HasOtherHealthyMembers ¶
func (mr *MockDBManagerMockRecorder) HasOtherHealthyMembers(arg0, arg1, arg2 interface{}) *gomock.Call
HasOtherHealthyMembers indicates an expected call of HasOtherHealthyMembers.
func (*MockDBManagerMockRecorder) InitializeCluster ¶
func (mr *MockDBManagerMockRecorder) InitializeCluster(arg0, arg1 interface{}) *gomock.Call
InitializeCluster indicates an expected call of InitializeCluster.
func (*MockDBManagerMockRecorder) IsClusterHealthy ¶
func (mr *MockDBManagerMockRecorder) IsClusterHealthy(arg0, arg1 interface{}) *gomock.Call
IsClusterHealthy indicates an expected call of IsClusterHealthy.
func (*MockDBManagerMockRecorder) IsClusterInitialized ¶
func (mr *MockDBManagerMockRecorder) IsClusterInitialized(arg0, arg1 interface{}) *gomock.Call
IsClusterInitialized indicates an expected call of IsClusterInitialized.
func (*MockDBManagerMockRecorder) IsCurrentMemberHealthy ¶
func (mr *MockDBManagerMockRecorder) IsCurrentMemberHealthy(arg0, arg1 interface{}) *gomock.Call
IsCurrentMemberHealthy indicates an expected call of IsCurrentMemberHealthy.
func (*MockDBManagerMockRecorder) IsCurrentMemberInCluster ¶
func (mr *MockDBManagerMockRecorder) IsCurrentMemberInCluster(arg0, arg1 interface{}) *gomock.Call
IsCurrentMemberInCluster indicates an expected call of IsCurrentMemberInCluster.
func (*MockDBManagerMockRecorder) IsDBStartupReady ¶
func (mr *MockDBManagerMockRecorder) IsDBStartupReady() *gomock.Call
IsDBStartupReady indicates an expected call of IsDBStartupReady.
func (*MockDBManagerMockRecorder) IsFirstMember ¶
func (mr *MockDBManagerMockRecorder) IsFirstMember() *gomock.Call
IsFirstMember indicates an expected call of IsFirstMember.
func (*MockDBManagerMockRecorder) IsLeader ¶
func (mr *MockDBManagerMockRecorder) IsLeader(arg0, arg1 interface{}) *gomock.Call
IsLeader indicates an expected call of IsLeader.
func (*MockDBManagerMockRecorder) IsLeaderMember ¶
func (mr *MockDBManagerMockRecorder) IsLeaderMember(arg0, arg1, arg2 interface{}) *gomock.Call
IsLeaderMember indicates an expected call of IsLeaderMember.
func (*MockDBManagerMockRecorder) IsMemberHealthy ¶
func (mr *MockDBManagerMockRecorder) IsMemberHealthy(arg0, arg1, arg2 interface{}) *gomock.Call
IsMemberHealthy indicates an expected call of IsMemberHealthy.
func (*MockDBManagerMockRecorder) IsMemberLagging ¶
func (mr *MockDBManagerMockRecorder) IsMemberLagging(arg0, arg1, arg2 interface{}) *gomock.Call
IsMemberLagging indicates an expected call of IsMemberLagging.
func (*MockDBManagerMockRecorder) IsPromoted ¶
func (mr *MockDBManagerMockRecorder) IsPromoted(arg0 interface{}) *gomock.Call
IsPromoted indicates an expected call of IsPromoted.
func (*MockDBManagerMockRecorder) IsRootCreated ¶
func (mr *MockDBManagerMockRecorder) IsRootCreated(arg0 interface{}) *gomock.Call
IsRootCreated indicates an expected call of IsRootCreated.
func (*MockDBManagerMockRecorder) IsRunning ¶
func (mr *MockDBManagerMockRecorder) IsRunning() *gomock.Call
IsRunning indicates an expected call of IsRunning.
func (*MockDBManagerMockRecorder) JoinCurrentMemberToCluster ¶
func (mr *MockDBManagerMockRecorder) JoinCurrentMemberToCluster(arg0, arg1 interface{}) *gomock.Call
JoinCurrentMemberToCluster indicates an expected call of JoinCurrentMemberToCluster.
func (*MockDBManagerMockRecorder) LeaveMemberFromCluster ¶
func (mr *MockDBManagerMockRecorder) LeaveMemberFromCluster(arg0, arg1, arg2 interface{}) *gomock.Call
LeaveMemberFromCluster indicates an expected call of LeaveMemberFromCluster.
func (*MockDBManagerMockRecorder) ListSystemAccounts ¶
func (mr *MockDBManagerMockRecorder) ListSystemAccounts(arg0 interface{}) *gomock.Call
ListSystemAccounts indicates an expected call of ListSystemAccounts.
func (*MockDBManagerMockRecorder) ListUsers ¶
func (mr *MockDBManagerMockRecorder) ListUsers(arg0 interface{}) *gomock.Call
ListUsers indicates an expected call of ListUsers.
func (*MockDBManagerMockRecorder) Lock ¶
func (mr *MockDBManagerMockRecorder) Lock(arg0, arg1 interface{}) *gomock.Call
Lock indicates an expected call of Lock.
func (*MockDBManagerMockRecorder) MoveData ¶
func (mr *MockDBManagerMockRecorder) MoveData(arg0, arg1 interface{}) *gomock.Call
MoveData indicates an expected call of MoveData.
func (*MockDBManagerMockRecorder) Promote ¶
func (mr *MockDBManagerMockRecorder) Promote(arg0, arg1 interface{}) *gomock.Call
Promote indicates an expected call of Promote.
func (*MockDBManagerMockRecorder) Query ¶
func (mr *MockDBManagerMockRecorder) Query(arg0, arg1 interface{}) *gomock.Call
Query indicates an expected call of Query.
func (*MockDBManagerMockRecorder) Recover ¶
func (mr *MockDBManagerMockRecorder) Recover(arg0 interface{}) *gomock.Call
Recover indicates an expected call of Recover.
func (*MockDBManagerMockRecorder) RevokeUserRole ¶
func (mr *MockDBManagerMockRecorder) RevokeUserRole(arg0, arg1, arg2 interface{}) *gomock.Call
RevokeUserRole indicates an expected call of RevokeUserRole.
func (*MockDBManagerMockRecorder) ShutDownWithWait ¶
func (mr *MockDBManagerMockRecorder) ShutDownWithWait() *gomock.Call
ShutDownWithWait indicates an expected call of ShutDownWithWait.
func (*MockDBManagerMockRecorder) Start ¶
func (mr *MockDBManagerMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call
Start indicates an expected call of Start.
func (*MockDBManagerMockRecorder) Stop ¶
func (mr *MockDBManagerMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
func (*MockDBManagerMockRecorder) Unlock ¶
func (mr *MockDBManagerMockRecorder) Unlock(arg0 interface{}) *gomock.Call
Unlock indicates an expected call of Unlock.
type MockManager ¶
type MockManager struct {
DBManagerBase
}
func (*MockManager) CreateRoot ¶
func (*MockManager) CreateRoot(context.Context) error
func (*MockManager) GetHealthiestMember ¶
func (*MockManager) GetMemberAddrs ¶
func (*MockManager) HasOtherHealthyLeader ¶
func (*MockManager) HasOtherHealthyMembers ¶
func (*MockManager) InitializeCluster ¶
func (*MockManager) IsClusterHealthy ¶
func (*MockManager) IsClusterInitialized ¶
func (*MockManager) IsCurrentMemberHealthy ¶
func (*MockManager) IsCurrentMemberInCluster ¶
func (*MockManager) IsDBStartupReady ¶
func (*MockManager) IsDBStartupReady() bool
func (*MockManager) IsFirstMember ¶
func (*MockManager) IsFirstMember() bool
func (*MockManager) IsLeaderMember ¶
func (*MockManager) IsMemberHealthy ¶
func (*MockManager) IsPromoted ¶
func (*MockManager) IsPromoted(context.Context) bool
func (*MockManager) IsRootCreated ¶
func (*MockManager) IsRootCreated(context.Context) (bool, error)
func (*MockManager) IsRunning ¶
func (*MockManager) IsRunning() bool
func (*MockManager) JoinCurrentMemberToCluster ¶
func (*MockManager) LeaveMemberFromCluster ¶
type NewCommandFunc ¶
type NewCommandFunc func() ClusterCommands