configer

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package configer is a generated GoMock package.

Index

Constants

View Source
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

View Source
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

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

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

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 PeerDevice struct {
	NodeID int
	// ConnectionName=hostname
	ConnectionName string
	// local node state on the connection to this peer
	Replication string
	DiskState   string
}

type Resource

type Resource struct {
	Name   string // Name = replica.Name
	Role   string
	Device struct {
		State string
	}
	Replication string
	PeerDevices map[string]*PeerDevice
}

type SyncReplicaStatus

type SyncReplicaStatus func(replicaName string)

Jump to

Keyboard shortcuts

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