fake

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoLag is the constant that sets an instance as no lag
	NoLag int64 = -1
)

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 New

func New() *OrcFakeClient

New fake orchestrator client

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.4

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

Jump to

Keyboard shortcuts

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