client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package client ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel ...

func (*Channel) CheckTime

func (p *Channel) CheckTime(nowNS int64) bool

CheckTime ...

func (*Channel) Free

func (p *Channel) Free(stream *rpc.Stream) bool

Free ...

func (*Channel) Use

func (p *Channel) Use(item *SendItem, channelSize int) bool

Use ...

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Client ...

func NewClient added in v0.0.2

func NewClient(
	network string,
	addr string,
	tlsConfig *tls.Config,
	rBufSize int,
	wBufSize int,
	onError func(err *base.Error),
) *Client

NewClient ...

func (*Client) Close

func (p *Client) Close() bool

Close ...

func (*Client) OnConnClose

func (p *Client) OnConnClose(_ *adapter.StreamConn)

OnConnClose ...

func (*Client) OnConnError

func (p *Client) OnConnError(streamConn *adapter.StreamConn, err *base.Error)

OnConnError ...

func (*Client) OnConnOpen

func (p *Client) OnConnOpen(streamConn *adapter.StreamConn)

OnConnOpen ...

func (*Client) OnConnReadStream

func (p *Client) OnConnReadStream(
	streamConn *adapter.StreamConn,
	stream *rpc.Stream,
)

OnConnReadStream ...

func (*Client) Send

func (p *Client) Send(
	timeout time.Duration,
	target string,
	args ...interface{},
) (interface{}, *base.Error)

Send ...

func (*Client) Subscribe

func (p *Client) Subscribe(
	nodePath string,
	message string,
	fn func(value rpc.Any),
) *Subscription

Subscribe ...

type Config

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

Config ...

type SendItem

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

SendItem ...

func NewSendItem

func NewSendItem(timeoutNS int64) *SendItem

NewSendItem ...

func (*SendItem) Back

func (p *SendItem) Back(stream *rpc.Stream) bool

Back ...

func (*SendItem) CheckTime

func (p *SendItem) CheckTime(nowNS int64) bool

CheckTime ...

func (*SendItem) Release

func (p *SendItem) Release()

Release ...

type Subscription

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

Subscription ...

func (*Subscription) Close

func (p *Subscription) Close()

Close ...

Jump to

Keyboard shortcuts

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