encoders

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 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 EncodedMessage

type EncodedMessage interface {
	GetType() string
}

type Encoder

type Encoder interface {
	ID() string
	Encode(msg EncodedMessage) (*ws.SentFrame, error)
	EncodeTransmission(msg string) (*ws.SentFrame, error)
	Decode(payload []byte) (*common.Message, error)
}

type JSON

type JSON struct {
}

func (JSON) Decode

func (JSON) Decode(raw []byte) (*common.Message, error)

func (JSON) Encode

func (JSON) Encode(msg EncodedMessage) (*ws.SentFrame, error)

func (JSON) EncodeTransmission

func (JSON) EncodeTransmission(msg string) (*ws.SentFrame, error)

func (JSON) ID

func (JSON) ID() string

type Msgpack

type Msgpack struct {
}

func (Msgpack) Decode

func (Msgpack) Decode(raw []byte) (*common.Message, error)

func (Msgpack) Encode

func (Msgpack) Encode(msg EncodedMessage) (*ws.SentFrame, error)

func (Msgpack) EncodeTransmission

func (m Msgpack) EncodeTransmission(raw string) (*ws.SentFrame, error)

func (Msgpack) ID

func (Msgpack) ID() string

type Protobuf

type Protobuf struct {
}

func (Protobuf) Decode

func (Protobuf) Decode(raw []byte) (*common.Message, error)

func (Protobuf) Encode

func (Protobuf) Encode(msg EncodedMessage) (*ws.SentFrame, error)

func (Protobuf) EncodeTransmission

func (p Protobuf) EncodeTransmission(raw string) (*ws.SentFrame, error)

func (Protobuf) ID

func (Protobuf) ID() string

Jump to

Keyboard shortcuts

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