ws

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WSMessageBufferSize = 100
	HeaderPartsNumber   = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v0.2.0

type Connection struct {
	Messages chan Message
	// contains filtered or unexported fields
}

func NewWS

func NewWS(url string, opts Options) (*Connection, error)

func (*Connection) Close added in v0.2.0

func (wsInsp *Connection) Close()

func (*Connection) Send added in v0.2.0

func (wsInsp *Connection) Send(msg string) error

type Message

type Message struct {
	Data string      `json:"data"`
	Type MessageType `json:"type"`
}

type MessageType

type MessageType uint8
const (
	NotDefined MessageType = iota
	Request
	Response
)

func (MessageType) String added in v0.2.0

func (mt MessageType) String() string

type Options added in v0.2.0

type Options struct {
	Headers             []string
	SkipSSLVerification bool
	WaitForResp         int
}

Jump to

Keyboard shortcuts

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