client

package
v0.0.0-...-7370945 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTimeout is the error returned when things time out
	ErrTimeout = errors.New("timeout")
)

Functions

This section is empty.

Types

type Client

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

Client is a low-level metadata server client that can send and receive message.Message's. It can be used to build higher level clients, e.g., a storage.VersionedStore implementation.

func New

func New(opts ...Option) *Client

New creates an instance of the client with the provided options

func (*Client) Close

func (c *Client) Close()

Close closes the client connection

func (*Client) Receive

func (c *Client) Receive(m *message.Message) error

Receive receives a message from the server.

func (*Client) Send

func (c *Client) Send(m message.Message) error

Send sends the message to the server.

type Option

type Option func(*options)

Option is a client functional option for configuring the client

func WithAddress

func WithAddress(value string) Option

WithAddress sets the address for the client co connect to

func WithFallbackToPlainTCP

func WithFallbackToPlainTCP() Option

WithFallbackToPlainTCP configures the client to fallback to plain unsecured TCP

Jump to

Keyboard shortcuts

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