oneway

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OneWayTcpClient

type OneWayTcpClient struct {
	License string        `toml:"license"`
	Servers []string      `toml:"servers"`
	Pcode   int64         `toml:"project_code"`
	Timeout time.Duration `toml:"timeout"`
	Log     logger.Logger
	Oname   string
	Oid     int32

	Queue *queue.RequestQueue

	UseQueue       bool
	ConfigObserver *config.ConfigObserver
	// contains filtered or unexported fields
}

func GetOneWayTcpClient

func GetOneWayTcpClient(opts ...OneWayTcpClientOption) *OneWayTcpClient

func (*OneWayTcpClient) ApplyConfig

func (this *OneWayTcpClient) ApplyConfig(conf config.Config)

implements common.ConfigObserver

func (*OneWayTcpClient) Close

func (this *OneWayTcpClient) Close() error

func (*OneWayTcpClient) Connect

func (this *OneWayTcpClient) Connect() error

func (*OneWayTcpClient) Destroy

func (this *OneWayTcpClient) Destroy() error

func (*OneWayTcpClient) Flush

func (this *OneWayTcpClient) Flush() (n int, err error)

func (*OneWayTcpClient) Send

func (this *OneWayTcpClient) Send(p pack.Pack, opts ...wnet.TcpClientOption) error

func (*OneWayTcpClient) SendAndClear

func (this *OneWayTcpClient) SendAndClear() error

func (*OneWayTcpClient) SendFlush

func (this *OneWayTcpClient) SendFlush(p pack.Pack, flush bool, opts ...wnet.TcpClientOption) error

type OneWayTcpClientOption

type OneWayTcpClientOption interface {
	// contains filtered or unexported methods
}

func WithConfigObserver

func WithConfigObserver(obj *config.ConfigObserver) OneWayTcpClientOption

func WithLicense added in v0.0.15

func WithLicense(license string) OneWayTcpClientOption

func WithLogger

func WithLogger(logger logger.Logger) OneWayTcpClientOption

func WithOid added in v0.0.15

func WithOid(oid int32) OneWayTcpClientOption

func WithPcode added in v0.0.15

func WithPcode(pcode int64) OneWayTcpClientOption

func WithQueueSize added in v0.0.19

func WithQueueSize(size int32) OneWayTcpClientOption

func WithServers added in v0.0.15

func WithServers(servers []string) OneWayTcpClientOption

func WithUseQueue

func WithUseQueue() OneWayTcpClientOption

Jump to

Keyboard shortcuts

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