client

package
v0.0.0-...-3b1ec4e Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UDP = iota
	UDP4
	UDP6
	TCP
	TCP4
	TCP6
	UNIX
)
View Source
const (
	SendOnly = iota
	SendRecv
	SendRecvMultiplex
	SendStreamOnly
	SendStreamAndRecv
	SendAndRecvStream
	SendStreamAndRecvStream
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Invoke(ctx context.Context, reqHead interface{}, opts ...Option) (rspHead interface{}, err error)
}

func NewClient

func NewClient(name string, conf clientv3.Config, typ selector.SelectorType, opts ...Option) Client

type Option

type Option func(*client)

func WithAddr

func WithAddr(addr string) Option

func WithCodec

func WithCodec(name string) Option

WithCodec specify the codec

func WithRpcType

func WithRpcType(typ RpcType) Option

WithRpcType specify the rpc type, support SendOnly, SendRecv, SendRecvWithMultiplex, etc.

func WithSelector

func WithSelector(selector selector.Selector) Option

WithSelector specify the selector

func WithTransportType

func WithTransportType(typ TransportType) Option

WithTransportType specify the transport type, support UDP, TCP, Unix

type RpcType

type RpcType int

RpcType options

type TransportType

type TransportType int

TransportType options

func (TransportType) String

func (t TransportType) String() string

func (TransportType) Valid

func (t TransportType) Valid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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