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) Clear()
- 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) DiscoverVTGateAddrs(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) DiscoverVtctldAddrs(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 ¶
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) DiscoverVTGateAddrs ¶
DiscoverVTGateAddrs is part of the discovery.Discovery interface.
func (*Fake) DiscoverVTGates ¶
DiscoverVTGates is part of the discovery.Discovery interface.
func (*Fake) DiscoverVtctld ¶
DiscoverVtctld is part of the discover.Discovery interface.
func (*Fake) DiscoverVtctldAddr ¶
DiscoverVtctldAddr is part of the discover.Discovery interface.
func (*Fake) DiscoverVtctldAddrs ¶
DiscoverVtctldAddrs is part of the discovery.Discovery interface.
func (*Fake) DiscoverVtctlds ¶
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 ¶
SetVtctldsError instructs whether the fake should return an error on vtctld discovery functions.