client

package
v0.0.0-...-fc15ddb Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeepAlivePeriod = 300
)

Functions

This section is empty.

Types

type Client

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

Client represents a single unique connection with convenience methods to return a Limited bufio.Reader, Writer, and Closer. Limited Reader provides a circuit breaker for out of bound requests.

func New

func New(conn Conn, n int64) *Client

func (*Client) Closer

func (c *Client) Closer() io.Closer

Return Closer

func (*Client) Reader

func (c *Client) Reader() *bufio.Reader

Return Limited Bufio Reader Callers should invoke ResetLimit to reset read limits to original value.

func (*Client) ResetLimit

func (c *Client) ResetLimit()

Reset the read limit back to original value. It is expected to be reset for every new cmd or read "session".

func (*Client) Writer

func (c *Client) Writer() io.Writer

Return Writer

type Conn

type Conn interface {
	io.Reader
	io.Writer
	io.Closer
	SetKeepAlive(keepalive bool) error
	SetKeepAlivePeriod(d time.Duration) error
}

Conn interface to clarify actual behavior required and for easier integration testing.

Jump to

Keyboard shortcuts

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