webroker

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleConn

func HandleConn(connIdEncoder ConnIdEncoder, conn tcp.NetConn) (err error)

func NewMapper added in v0.4.0

func NewMapper(cap uint32) *mapper

func Send added in v0.3.1

func Send(addr string, target string, data []byte, timeout time.Duration) error

Types

type Client added in v0.3.1

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

func Dial added in v0.3.1

func Dial(addr string) (*Client, error)

func (*Client) Conn added in v0.3.1

func (c *Client) Conn() net.Conn

func (*Client) Host added in v0.4.0

func (c *Client) Host() net.Addr

func (*Client) ID added in v0.3.1

func (c *Client) ID() string

func (*Client) Next added in v0.3.1

func (c *Client) Next() ([]byte, error)

type ConnIdEncoder added in v0.4.0

type ConnIdEncoder interface {
	Encode(int) string
	Decode(string) int
}

type DefaultConnIdEncoder added in v0.4.0

type DefaultConnIdEncoder struct{}

func (DefaultConnIdEncoder) Decode added in v0.4.0

func (DefaultConnIdEncoder) Decode(str string) int

func (DefaultConnIdEncoder) Encode added in v0.4.0

func (DefaultConnIdEncoder) Encode(id int) string

Directories

Path Synopsis
cmd
pkg
tcp

Jump to

Keyboard shortcuts

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