websocket

package
v0.0.0-...-f0f60d2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 4 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 {
	Conn      *websocket.Conn
	Retry     int
	Heartbeat time.Duration
}

func New

func New(c *Config) *Client

func (Client) Read

func (c Client) Read(ch chan []byte)

消费消息

func (Client) Send

func (c Client) Send(b []byte)

发送消息

type Config

type Config struct {
	Scheme           string
	Host             string
	Path             string
	Protocol         []string
	Heartbeat        time.Duration
	HeartbeatContent []byte
}

Jump to

Keyboard shortcuts

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