v0

package
v0.0.0-...-a211f75 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextMessage  = 1
	CloseMessage = 2
)

Variables

This section is empty.

Functions

func Demo

func Demo()

Types

type Client

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

func NewClient

func NewClient(address string, pattern string, headers http.Header) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Read

func (c *Client) Read() (string, error)

func (*Client) Send

func (c *Client) Send(message []byte) error

type Connection

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

func NewConnection

func NewConnection(conn net.Conn) *Connection

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close() error

Close closes the underlying connection without a close frame

func (*Connection) Read

func (c *Connection) Read() ([]byte, error)

func (*Connection) Write

func (c *Connection) Write(messageType MessageType, message []byte) error

type MessageType

type MessageType int

Jump to

Keyboard shortcuts

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