Documentation
¶
Overview ¶
Package client is the Go end of a connection, which the server's tests and measurements use: calls from many goroutines, each a stream of its own, and their answers in any order. A Go program embeds the store instead.
Index ¶
- Variables
- type Conn
- func (c *Conn) Adopt(id uint32) (*Stream, error)
- func (c *Conn) Call(ctx context.Context, method wire.Method, request Message) ([]byte, error)
- func (c *Conn) Close() error
- func (c *Conn) CloseWrite() error
- func (c *Conn) Done() <-chan struct{}
- func (c *Conn) GoAway() *wire.GoAway
- func (c *Conn) Open(ctx context.Context, method wire.Method, request Message, end bool) (*Stream, error)
- func (c *Conn) SendFrame(frame []byte) error
- type Message
- type Stream
Constants ¶
This section is empty.
Variables ¶
var ErrNotTheServer = errors.New("client: the endpoint SERVE names cannot prove it read SERVE")
ErrNotTheServer is an endpoint whose WELCOME does not prove it read SERVE: the server that wrote SERVE is gone, and another process holds its endpoint.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn is a client's connection. Its reader never waits for the program: what the server sends waits on its stream, within the credit the client granted.
func Found ¶
Found reaches the sidecar that SERVE in <dir>/server/ names, as an SDK does. Its HELLO carries a fresh challenge, and no call goes before the WELCOME's proof checks.
func (*Conn) Call ¶
Call sends a request and waits for its answer's body; an ERROR is a *wire.Error.
func (*Conn) CloseWrite ¶
CloseWrite ends what the client sends, as a private child's parent closes its stdin, and leaves the answers to come.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is one stream as the client sees it: what it uploads, and the RESPONSE and DATA the server sends on it, waiting until they are taken.
func (*Stream) Cancel ¶
Cancel asks the server to stop the stream, which still ends with its final frame.
func (*Stream) Next ¶
Next waits for the next DATA: its body, and whether it ended the stream. It grants back what it takes, as a consumer that has room again.