fakediscovery

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fakediscovery provides a fake, in-memory discovery implementation.

Index

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 New

func New() *Fake

New returns a new fake.

func (*Fake) AddTaggedGates

func (d *Fake) AddTaggedGates(tags []string, gates ...*vtadminpb.VTGate)

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

func (d *Fake) AddTaggedVtctlds(tags []string, vtctlds ...*vtadminpb.Vtctld)

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

func (d *Fake) DiscoverVTGate(ctx context.Context, tags []string) (*vtadminpb.VTGate, error)

DiscoverVTGate is part of the discovery.Discovery interface.

func (*Fake) DiscoverVTGateAddr

func (d *Fake) DiscoverVTGateAddr(ctx context.Context, tags []string) (string, error)

DiscoverVTGateAddr is part of the discovery.Discovery interface.

func (*Fake) DiscoverVTGates

func (d *Fake) DiscoverVTGates(ctx context.Context, tags []string) ([]*vtadminpb.VTGate, error)

DiscoverVTGates is part of the discovery.Discovery interface.

func (*Fake) DiscoverVtctld added in v0.10.0

func (d *Fake) DiscoverVtctld(ctx context.Context, tags []string) (*vtadminpb.Vtctld, error)

DiscoverVtctld is part of the discover.Discovery interface.

func (*Fake) DiscoverVtctldAddr added in v0.10.0

func (d *Fake) DiscoverVtctldAddr(ctx context.Context, tags []string) (string, error)

DiscoverVtctldAddr is part of the discover.Discovery interface.

func (*Fake) DiscoverVtctlds added in v0.10.0

func (d *Fake) DiscoverVtctlds(ctx context.Context, tags []string) ([]*vtadminpb.Vtctld, error)

DiscoverVtctlds is part of the discover.Discovery interface.

func (*Fake) SetGatesError

func (d *Fake) SetGatesError(shouldErr bool)

SetGatesError instructs whether the fake should return an error on gate discovery functions.

func (*Fake) SetVtctldsError added in v0.12.0

func (d *Fake) SetVtctldsError(shouldErr bool)

SetVtctldsError instructs whether the fake should return an error on vtctld discovery functions.

Jump to

Keyboard shortcuts

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