Documentation ¶
Index ¶
- type OrcFakeClient
- func (o *OrcFakeClient) AckRecovery(id int64, comment string) error
- func (o *OrcFakeClient) AddInstance(instance Instance) *Instance
- func (o *OrcFakeClient) AddRecoveries(cluster string, ack bool) int64
- func (o *OrcFakeClient) AuditRecovery(cluster string) ([]TopologyRecovery, error)
- func (o *OrcFakeClient) BeginMaintenance(key InstanceKey, owner, reason string) error
- func (o *OrcFakeClient) CheckAck(id int64) bool
- func (o *OrcFakeClient) CheckDiscovered(key string) bool
- func (o *OrcFakeClient) Cluster(cluster string) ([]Instance, error)
- func (o *OrcFakeClient) Discover(host string, port int) error
- func (o *OrcFakeClient) EndMaintenance(key InstanceKey) error
- func (o *OrcFakeClient) Forget(host string, port int) error
- func (o *OrcFakeClient) Maintenance() ([]Maintenance, error)
- func (o *OrcFakeClient) MakeOrcUnreachable()
- func (o *OrcFakeClient) Master(clusterHint string) (*Instance, error)
- func (o *OrcFakeClient) RemoveInstance(cluster, host string)
- func (o *OrcFakeClient) Reset()
- func (o *OrcFakeClient) SetHostReadOnly(key InstanceKey) error
- func (o *OrcFakeClient) SetHostWritable(key InstanceKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrcFakeClient ¶
type OrcFakeClient struct { Clusters map[string][]*Instance Recoveries map[string][]TopologyRecovery AckRec []int64 Discovered []InstanceKey // contains filtered or unexported fields }
OrcFakeClient is a structure that implements orchestrator client interface used in testing
func (*OrcFakeClient) AckRecovery ¶
func (o *OrcFakeClient) AckRecovery(id int64, comment string) error
AckRecovery ack a recovery
func (*OrcFakeClient) AddInstance ¶
func (o *OrcFakeClient) AddInstance(instance Instance) *Instance
AddInstance add a instance to orchestrator client
func (*OrcFakeClient) AddRecoveries ¶
func (o *OrcFakeClient) AddRecoveries(cluster string, ack bool) int64
AddRecoveries add a recovery for a cluster
func (*OrcFakeClient) AuditRecovery ¶
func (o *OrcFakeClient) AuditRecovery(cluster string) ([]TopologyRecovery, error)
AuditRecovery returns recoveries for a cluster
func (*OrcFakeClient) BeginMaintenance ¶
func (o *OrcFakeClient) BeginMaintenance(key InstanceKey, owner, reason string) error
BeginMaintenance set a host in maintenance
func (*OrcFakeClient) CheckAck ¶
func (o *OrcFakeClient) CheckAck(id int64) bool
CheckAck verify is an ack is present
func (*OrcFakeClient) CheckDiscovered ¶
func (o *OrcFakeClient) CheckDiscovered(key string) bool
CheckDiscovered verify if a key was discovered or not
func (*OrcFakeClient) Cluster ¶
func (o *OrcFakeClient) Cluster(cluster string) ([]Instance, error)
Cluster returns the list of instances from a cluster
func (*OrcFakeClient) Discover ¶
func (o *OrcFakeClient) Discover(host string, port int) error
Discover register a host into orchestrator
func (*OrcFakeClient) EndMaintenance ¶
func (o *OrcFakeClient) EndMaintenance(key InstanceKey) error
EndMaintenance set a host in maintenance
func (*OrcFakeClient) Forget ¶
func (o *OrcFakeClient) Forget(host string, port int) error
Forget removes a host from orchestrator
func (*OrcFakeClient) Maintenance ¶
func (o *OrcFakeClient) Maintenance() ([]Maintenance, error)
Maintenance put a node into maintenance
func (*OrcFakeClient) MakeOrcUnreachable ¶ added in v0.2.5
func (o *OrcFakeClient) MakeOrcUnreachable()
MakeOrcUnreachable makes every function return an error
func (*OrcFakeClient) Master ¶
func (o *OrcFakeClient) Master(clusterHint string) (*Instance, error)
Master returns the master of a cluster
func (*OrcFakeClient) RemoveInstance ¶
func (o *OrcFakeClient) RemoveInstance(cluster, host string)
RemoveInstance deletes a instance from orchestrator
func (*OrcFakeClient) Reset ¶
func (o *OrcFakeClient) Reset()
Reset removes all instances and ack from a client
func (*OrcFakeClient) SetHostReadOnly ¶
func (o *OrcFakeClient) SetHostReadOnly(key InstanceKey) error
SetHostReadOnly make a host read only
func (*OrcFakeClient) SetHostWritable ¶
func (o *OrcFakeClient) SetHostWritable(key InstanceKey) error
SetHostWritable make a host writable