Documentation ¶
Overview ¶
Package configer is a generated GoMock package.
Index ¶
- Constants
- Variables
- func NewDRBDConfiger(hostname string, systemConfig apisv1alpha1.SystemConfig, ...) (*drbdConfigure, error)
- type Configer
- type MockConfiger
- func (m *MockConfiger) ApplyConfig(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) error
- func (m *MockConfiger) ConsistencyCheck(replicas []apisv1alpha1.LocalVolumeReplica)
- func (m *MockConfiger) DeleteConfig(replica *apisv1alpha1.LocalVolumeReplica) error
- func (m *MockConfiger) EXPECT() *MockConfigerMockRecorder
- func (m *MockConfiger) GetReplicaHAState(replica *apisv1alpha1.LocalVolumeReplica) (apisv1alpha1.HAState, error)
- func (m *MockConfiger) HasConfig(replica *apisv1alpha1.LocalVolumeReplica) bool
- func (m *MockConfiger) Initialize(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) error
- func (m *MockConfiger) IsConfigUpdated(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) bool
- func (m *MockConfiger) Run(stopCh <-chan struct{})
- type MockConfigerMockRecorder
- func (mr *MockConfigerMockRecorder) ApplyConfig(replica, config interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) ConsistencyCheck(replicas interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) DeleteConfig(replica interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) GetReplicaHAState(replica interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) HasConfig(replica interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) Initialize(replica, config interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) IsConfigUpdated(replica, config interface{}) *gomock.Call
- func (mr *MockConfigerMockRecorder) Run(stopCh interface{}) *gomock.Call
- type PeerDevice
- type Resource
- type SyncReplicaStatus
Constants ¶
const ( // disk state, https://www.linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-disk-states DiskStateUpToDate = "UpToDate" DiskStateOutdated = "Outdated" DiskStateInconsistent = "Inconsistent" DiskStateConsistent = "Consistent" DiskStateDiskless = "Diskless" DiskStateNegotiating = "Negotiating" DiskStateDetaching = "Detaching" DiskStateAttaching = "Attaching" ConnectionStateConnected = "Connected" ConnectionStateConnecting = "Connecting" ConnectionStateDisconnecting = "Disconnecting" // replication state, https://www.linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-replication-states ReplicationEstablished = "Established" ReplicationSyncSource = "SyncSource" ReplicationSyncTarget = "SyncTarget" )
Variables ¶
var ErrNotSupportedConfiger = fmt.Errorf("no configer found for this system mode")
Functions ¶
func NewDRBDConfiger ¶
func NewDRBDConfiger(hostname string, systemConfig apisv1alpha1.SystemConfig, apiClient client.Client, syncFunc SyncReplicaStatus) (*drbdConfigure, error)
Types ¶
type Configer ¶
type Configer interface { Run(stopCh <-chan struct{}) // check if the config is updated with the new content IsConfigUpdated(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) bool // create or update config for replica, and use replica.Status.StoragePath // create new device at replica.Status.DevicePath ApplyConfig(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) error // Initialize do the initalization for volume Initialize(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) error // delete config for replica, will remove the resource DeleteConfig(replica *apisv1alpha1.LocalVolumeReplica) error // check if there is a config on the replica HasConfig(replica *apisv1alpha1.LocalVolumeReplica) bool // GetReplicaHAState return replica state, synced, err GetReplicaHAState(replica *apisv1alpha1.LocalVolumeReplica) (state apisv1alpha1.HAState, err error) ConsistencyCheck(replicas []apisv1alpha1.LocalVolumeReplica) }
func ConfigerFactory ¶
func ConfigerFactory(hostname string, config apisv1alpha1.SystemConfig, apiClient client.Client, syncFunc SyncReplicaStatus) (Configer, error)
type MockConfiger ¶
type MockConfiger struct {
// contains filtered or unexported fields
}
MockConfiger is a mock of Configer interface.
func NewMockConfiger ¶
func NewMockConfiger(ctrl *gomock.Controller) *MockConfiger
NewMockConfiger creates a new mock instance.
func (*MockConfiger) ApplyConfig ¶
func (m *MockConfiger) ApplyConfig(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) error
ApplyConfig mocks base method.
func (*MockConfiger) ConsistencyCheck ¶
func (m *MockConfiger) ConsistencyCheck(replicas []apisv1alpha1.LocalVolumeReplica)
ConsistencyCheck mocks base method.
func (*MockConfiger) DeleteConfig ¶
func (m *MockConfiger) DeleteConfig(replica *apisv1alpha1.LocalVolumeReplica) error
DeleteConfig mocks base method.
func (*MockConfiger) EXPECT ¶
func (m *MockConfiger) EXPECT() *MockConfigerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConfiger) GetReplicaHAState ¶
func (m *MockConfiger) GetReplicaHAState(replica *apisv1alpha1.LocalVolumeReplica) (apisv1alpha1.HAState, error)
GetReplicaHAState mocks base method.
func (*MockConfiger) HasConfig ¶
func (m *MockConfiger) HasConfig(replica *apisv1alpha1.LocalVolumeReplica) bool
HasConfig mocks base method.
func (*MockConfiger) Initialize ¶
func (m *MockConfiger) Initialize(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) error
Initialize mocks base method.
func (*MockConfiger) IsConfigUpdated ¶
func (m *MockConfiger) IsConfigUpdated(replica *apisv1alpha1.LocalVolumeReplica, config apisv1alpha1.VolumeConfig) bool
IsConfigUpdated mocks base method.
func (*MockConfiger) Run ¶
func (m *MockConfiger) Run(stopCh <-chan struct{})
Run mocks base method.
type MockConfigerMockRecorder ¶
type MockConfigerMockRecorder struct {
// contains filtered or unexported fields
}
MockConfigerMockRecorder is the mock recorder for MockConfiger.
func (*MockConfigerMockRecorder) ApplyConfig ¶
func (mr *MockConfigerMockRecorder) ApplyConfig(replica, config interface{}) *gomock.Call
ApplyConfig indicates an expected call of ApplyConfig.
func (*MockConfigerMockRecorder) ConsistencyCheck ¶
func (mr *MockConfigerMockRecorder) ConsistencyCheck(replicas interface{}) *gomock.Call
ConsistencyCheck indicates an expected call of ConsistencyCheck.
func (*MockConfigerMockRecorder) DeleteConfig ¶
func (mr *MockConfigerMockRecorder) DeleteConfig(replica interface{}) *gomock.Call
DeleteConfig indicates an expected call of DeleteConfig.
func (*MockConfigerMockRecorder) GetReplicaHAState ¶
func (mr *MockConfigerMockRecorder) GetReplicaHAState(replica interface{}) *gomock.Call
GetReplicaHAState indicates an expected call of GetReplicaHAState.
func (*MockConfigerMockRecorder) HasConfig ¶
func (mr *MockConfigerMockRecorder) HasConfig(replica interface{}) *gomock.Call
HasConfig indicates an expected call of HasConfig.
func (*MockConfigerMockRecorder) Initialize ¶
func (mr *MockConfigerMockRecorder) Initialize(replica, config interface{}) *gomock.Call
Initialize indicates an expected call of Initialize.
func (*MockConfigerMockRecorder) IsConfigUpdated ¶
func (mr *MockConfigerMockRecorder) IsConfigUpdated(replica, config interface{}) *gomock.Call
IsConfigUpdated indicates an expected call of IsConfigUpdated.
func (*MockConfigerMockRecorder) Run ¶
func (mr *MockConfigerMockRecorder) Run(stopCh interface{}) *gomock.Call
Run indicates an expected call of Run.
type PeerDevice ¶
type SyncReplicaStatus ¶
type SyncReplicaStatus func(replicaName string)