gobwasws

package
v0.0.0-...-c1a9e9f Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(bindings *runWs.ChannelBindings, conn net.Conn, clientSide bool) *Channel

func (Channel) Close

func (s Channel) Close() error

func (Channel) Receive

func (s Channel) Receive(ctx context.Context, cb func(envelope runWs.EnvelopeReader)) error

func (Channel) Send

func (s Channel) Send(ctx context.Context, envelopes ...runWs.EnvelopeWriter) error

type ConsumeClient

type ConsumeClient struct {
	http.ServeMux
	Upgrader HTTPUpgraderInterface
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(bindings *runWs.ServerBindings, httpResponseTimeout time.Duration) (*ConsumeClient, error)

func (*ConsumeClient) Subscriber

func (c *ConsumeClient) Subscriber(ctx context.Context, channelName string, bindings *runWs.ChannelBindings) (runWs.Subscriber, error)

type EnvelopeIn

type EnvelopeIn struct {
	wsutil.Message
	// contains filtered or unexported fields
}

func NewEnvelopeIn

func NewEnvelopeIn(msg wsutil.Message) *EnvelopeIn

func (*EnvelopeIn) Headers

func (e *EnvelopeIn) Headers() run.Headers

func (*EnvelopeIn) Read

func (e *EnvelopeIn) Read(p []byte) (n int, err error)

type EnvelopeOut

type EnvelopeOut struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func NewEnvelopeOut

func NewEnvelopeOut() *EnvelopeOut

func (*EnvelopeOut) OpCode

func (e *EnvelopeOut) OpCode() ws.OpCode

func (*EnvelopeOut) ResetPayload

func (e *EnvelopeOut) ResetPayload()

func (*EnvelopeOut) SetBindings

func (e *EnvelopeOut) SetBindings(_ runWs.MessageBindings)

func (*EnvelopeOut) SetContentType

func (e *EnvelopeOut) SetContentType(contentType string)

func (*EnvelopeOut) SetHeaders

func (e *EnvelopeOut) SetHeaders(headers run.Headers)

func (*EnvelopeOut) SetOpCode

func (e *EnvelopeOut) SetOpCode(opCode byte)

type HTTPUpgraderInterface

type HTTPUpgraderInterface interface {
	Upgrade(r *http.Request, w http.ResponseWriter) (conn net.Conn, rw *bufio.ReadWriter, hs ws.Handshake, err error)
}

type ImplementationRecord

type ImplementationRecord interface {
	Bytes() []byte
	OpCode() ws.OpCode
}

type ProduceClient

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

func NewProducer

func NewProducer(serverURL string, bindings *runWs.ServerBindings) (*ProduceClient, error)

func (ProduceClient) Publisher

func (p ProduceClient) Publisher(ctx context.Context, channelName string, bindings *runWs.ChannelBindings) (runWs.Publisher, error)

Jump to

Keyboard shortcuts

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