xwebsocket

package
v0.0.0-...-24c6111 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOption

type ClientOption func(dialer *ws.Dialer)

func ClientTLSConfig

func ClientTLSConfig(tc *tls.Config) ClientOption

type Server

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

func StartSimpleServer

func StartSimpleServer(ctx context.Context, g *errgroup.Group, addr string, sessionFactoryFunc WSSessionFactoryFunc) (*Server, error)

func (Server) Port

func (s Server) Port() int

type WSSession

type WSSession interface {
	Consume() error
	Close(err error) // should be idempotent
}

func NewClient

func NewClient(ctx context.Context, connectAddr string, sessionFactoryFunc WSSessionFactoryFunc, opts ...ClientOption) (WSSession, error)

type WSSessionFactoryFunc

type WSSessionFactoryFunc func(ctx context.Context, conn net.Conn) WSSession

Jump to

Keyboard shortcuts

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