packer

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packer

type Packer struct{}

Packer encodes messages using the NO-OP format - sending them as-is, with only a header to indicate message format.

func New

func New(ctx packer.Provider) *Packer

New will create a Packer that transmits messages IN PLAINTEXT. Never use this in production.

func (*Packer) EncodingType

func (p *Packer) EncodingType() string

EncodingType returns the type of the encoding, as found in the header `Typ` field.

func (*Packer) Pack

func (p *Packer) Pack(payload, sender []byte, recipientPubKeys [][]byte) ([]byte, error)

Pack will wrap the payload in a bit of JSON and send it as plaintext. Will fail on non-string payloads.

func (*Packer) Unpack

func (p *Packer) Unpack(message []byte) (*transport.Envelope, error)

Unpack will decode the envelope using the NOOP format.

Jump to

Keyboard shortcuts

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