client

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 13 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 struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts *options.ClientOptions) (c *Client, err error)

func (*Client) Ack

func (c *Client) Ack(event string, v interface{}, r interface{}) (err error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Emit

func (c *Client) Emit(event string, v interface{}) (err error)

func (*Client) FetchAddress added in v0.3.0

func (c *Client) FetchAddress() (err error)

func (*Client) IsClosed

func (c *Client) IsClosed() bool

func (*Client) MustStart

func (c *Client) MustStart()

func (*Client) On

func (c *Client) On(e string, fn EventHandler)

func (*Client) RemoteAddr

func (c *Client) RemoteAddr() string

func (*Client) Start

func (c *Client) Start() error

type Context

type Context interface {
	IsClosed() bool
	Close()

	Emit(event string, v interface{}) error
	Ack(event string, v interface{}, r interface{}) error

	Content() []byte
	Packet() protocol.Packet
	Bind(v interface{}) error

	Reply(v interface{}) error

	Logger() logger.Logger
}

type EventHandler

type EventHandler func(c Context) error

Jump to

Keyboard shortcuts

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