fastws

package module
v0.0.0-...-09b2620 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(opts ...Option) *bundle

func New

func New(opts ...Option) (*bundle, error)

Types

type Option

type Option func(b *bundle)

func Listen

func Listen(protoAddr string) Option

func WithCustomRPC

func WithCustomRPC(in kit.IncomingRPCFactory, out kit.OutgoingRPCFactory) Option

WithCustomRPC lets you define your RPC message container. RPC message container will be represented as Envelope in your application. RPCContainer only defines the behavior of serialization and deserialization of the Envelope.

func WithLogger

func WithLogger(l kit.Logger) Option

func WithPredicateKey

func WithPredicateKey(key string) Option

type Selector

type Selector struct {
	Predicate string
	Encoding  kit.Encoding
}

func RPC

func RPC(predicate string) Selector

RPC returns a selector that acts on websocket messages

func (Selector) GetEncoding

func (r Selector) GetEncoding() kit.Encoding

func (Selector) GetPredicate

func (r Selector) GetPredicate() string

func (Selector) Query

func (r Selector) Query(q string) interface{}

func (*Selector) SetEncoding

func (r *Selector) SetEncoding(enc kit.Encoding) *Selector

type SwitchProtocol

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

func (*SwitchProtocol) Upgrade

func (sp *SwitchProtocol) Upgrade(conn io.ReadWriter) (hs ws.Handshake, err error)

Jump to

Keyboard shortcuts

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