client

package
v0.0.0-...-eb37774 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2015 License: MIT Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// A human-readable unique name for the client, for use in statistics. A
	// reasonable name for a remote client would be the hostname:port, for
	// instance.
	Name() string

	// Send forwards a payload of `Data` instances to a remote system
	Send(lines []Data) error
}

type Data

type Data map[string]string

type StdoutClient

type StdoutClient struct {
}

StdoutClient writes messages to stardard out. It was useful for development.

func (*StdoutClient) Name

func (c *StdoutClient) Name() string

func (*StdoutClient) Send

func (c *StdoutClient) Send(lines []Data) error

type TestClient

type TestClient struct {
	DataSent []Data

	// Set Error to return an error to clients when they call Send. It is useful
	// for testing how they react to errors.
	Error error
}

TestClient is an in-memory client that allows inspecting the data that was 'sent' thorugh it. It is useful in test cases.

func (*TestClient) Name

func (c *TestClient) Name() string

func (*TestClient) Send

func (c *TestClient) Send(lines []Data) error

Jump to

Keyboard shortcuts

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