Documentation ¶
Overview ¶
Package fakediscovery provides a fake, in-memory discovery implementation.
Index ¶
- type Fake
- func (d *Fake) AddTaggedGates(tags []string, gates ...*vtadminpb.VTGate)
- func (d *Fake) AddTaggedVtctlds(tags []string, vtctlds ...*vtadminpb.Vtctld)
- func (d *Fake) DiscoverVTGate(ctx context.Context, tags []string) (*vtadminpb.VTGate, error)
- func (d *Fake) DiscoverVTGateAddr(ctx context.Context, tags []string) (string, error)
- func (d *Fake) DiscoverVTGates(ctx context.Context, tags []string) ([]*vtadminpb.VTGate, error)
- func (d *Fake) DiscoverVtctld(ctx context.Context, tags []string) (*vtadminpb.Vtctld, error)
- func (d *Fake) DiscoverVtctldAddr(ctx context.Context, tags []string) (string, error)
- func (d *Fake) DiscoverVtctlds(ctx context.Context, tags []string) ([]*vtadminpb.Vtctld, error)
- func (d *Fake) SetGatesError(shouldErr bool)
- func (d *Fake) SetVtctldsError(shouldErr bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake is a fake discovery implementation for use in testing.
func (*Fake) AddTaggedGates ¶
AddTaggedGates adds the given gates to the discovery fake, associating each gate with each tag. To tag different gates with multiple tags, call multiple times with the same gates but different tag slices. Gates are uniquely identified by hostname.
func (*Fake) AddTaggedVtctlds ¶ added in v0.10.0
AddTaggedVtctlds adds the given vtctlds to the discovery fake, associating each vtctld with each tag. To tag different vtctlds with multiple tags, call multiple times with the same vtctlds but different tag slices. Vtctlds are uniquely identified by hostname.
func (*Fake) DiscoverVTGate ¶
DiscoverVTGate is part of the discovery.Discovery interface.
func (*Fake) DiscoverVTGateAddr ¶
DiscoverVTGateAddr is part of the discovery.Discovery interface.
func (*Fake) DiscoverVTGates ¶
DiscoverVTGates is part of the discovery.Discovery interface.
func (*Fake) DiscoverVtctld ¶ added in v0.10.0
DiscoverVtctld is part of the discover.Discovery interface.
func (*Fake) DiscoverVtctldAddr ¶ added in v0.10.0
DiscoverVtctldAddr is part of the discover.Discovery interface.
func (*Fake) DiscoverVtctlds ¶ added in v0.10.0
DiscoverVtctlds is part of the discover.Discovery interface.
func (*Fake) SetGatesError ¶
SetGatesError instructs whether the fake should return an error on gate discovery functions.
func (*Fake) SetVtctldsError ¶ added in v0.12.0
SetVtctldsError instructs whether the fake should return an error on vtctld discovery functions.