go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/vtctl/fakevtctlclient Index | Files

package fakevtctlclient

import "gopkg.in/src-d/go-vitess.v1/vt/vtctl/fakevtctlclient"

Package fakevtctlclient contains a fake for the vtctlclient interface.

Index

Package Files

fake_loggerevent_streamingclient.go fakevtctlclient.go

type FakeLoggerEventStreamingClient Uses

type FakeLoggerEventStreamingClient struct {
    // contains filtered or unexported fields
}

FakeLoggerEventStreamingClient is the base for the fakes for the vtctlclient and vtworkerclient. It allows to register a (multi-)line string for a given command and return the result as channel which streams it back.

func NewFakeLoggerEventStreamingClient Uses

func NewFakeLoggerEventStreamingClient() *FakeLoggerEventStreamingClient

NewFakeLoggerEventStreamingClient creates a new fake.

func (*FakeLoggerEventStreamingClient) RegisterResult Uses

func (f *FakeLoggerEventStreamingClient) RegisterResult(args []string, output string, err error) error

RegisterResult registers for a given command (args) the result which the fake should return. Once the result was returned, it will be automatically deregistered.

func (*FakeLoggerEventStreamingClient) RegisterResultForAddr Uses

func (f *FakeLoggerEventStreamingClient) RegisterResultForAddr(addr string, args []string, output string, err error) error

RegisterResultForAddr is identical to RegisterResult but also expects that the client did dial "addr" as server address.

func (*FakeLoggerEventStreamingClient) RegisteredCommands Uses

func (f *FakeLoggerEventStreamingClient) RegisteredCommands() []string

RegisteredCommands returns a list of commands which are currently registered. This is useful to check that all registered results have been consumed.

func (*FakeLoggerEventStreamingClient) StreamResult Uses

func (f *FakeLoggerEventStreamingClient) StreamResult(addr string, args []string) (logutil.EventStream, error)

StreamResult returns an EventStream which streams back a registered result as logging events. "addr" is the server address which the client dialed and may be empty.

type FakeVtctlClient Uses

type FakeVtctlClient struct {
    *FakeLoggerEventStreamingClient
}

FakeVtctlClient is a fake which implements the vtctlclient interface. The fake can be used to return a specific result for a given command. If the command is not registered, an error will be thrown.

func NewFakeVtctlClient Uses

func NewFakeVtctlClient() *FakeVtctlClient

NewFakeVtctlClient creates a FakeVtctlClient struct.

func (*FakeVtctlClient) Close Uses

func (f *FakeVtctlClient) Close()

Close is part of the vtctlclient interface.

func (*FakeVtctlClient) ExecuteVtctlCommand Uses

func (f *FakeVtctlClient) ExecuteVtctlCommand(ctx context.Context, args []string, actionTimeout time.Duration) (logutil.EventStream, error)

ExecuteVtctlCommand is part of the vtctlclient interface.

func (*FakeVtctlClient) FakeVtctlClientFactory Uses

func (f *FakeVtctlClient) FakeVtctlClientFactory(addr string) (vtctlclient.VtctlClient, error)

FakeVtctlClientFactory always returns the current instance.

Package fakevtctlclient imports 9 packages (graph) and is imported by 2 packages. Updated 2019-07-02. Refresh now. Tools for package owners.