fastws

package
v0.6.21 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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

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 ronykit.Logger) Option

func WithPredicateKey

func WithPredicateKey(key string) Option

type Selector

type Selector struct {
	Predicate string
	Encoding  ronykit.Encoding
}

func RPC added in v0.6.4

func RPC(predicate string) Selector

RPC returns a selector that acts on websocket messages

func (Selector) GetEncoding added in v0.6.0

func (r Selector) GetEncoding() ronykit.Encoding

func (Selector) GetPredicate

func (r Selector) GetPredicate() string

func (Selector) Query

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

func (*Selector) SetEncoding added in v0.6.4

func (r *Selector) SetEncoding(enc ronykit.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