client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Init(opts ...Option) error
	Options() Options
	Out() chan *codec.Packet
	Send(data interface{}) error
	Recv(out interface{}) error
	Read()
	Close() error
	String() string
}

func NewClient

func NewClient(opts ...Option) (Client, error)

func NewTcpClient

func NewTcpClient(opts ...Option) (Client, error)

type Option

type Option func(o *Options)

func WithAddress

func WithAddress(addr string) Option

func WithCodec

func WithCodec(c codec.Codec) Option

func WithMaxRetries

func WithMaxRetries(retries int) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Options

type Options struct {
	Address    string
	MaxRetries int
	Timeout    time.Duration
	Codec      codec.Codec
}

Jump to

Keyboard shortcuts

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