encoding

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodecByte

type CodecByte struct{}

Byte identity codec for I/O kernet

func NewCodecByte

func NewCodecByte() CodecByte

func (CodecByte) Decode

func (CodecByte) Decode(x []byte) ([]byte, error)

func (CodecByte) Encode

func (CodecByte) Encode(x []byte) ([]byte, error)

type CodecEvent

type CodecEvent[M, T any] struct {
	// contains filtered or unexported fields
}

Event codec for I/O kernel

func NewCodecEvent

func NewCodecEvent[M, T any](source, cat string) CodecEvent[M, T]

func (CodecEvent[M, T]) Decode

func (c CodecEvent[M, T]) Decode(b []byte) (swarm.Event[M, T], error)

func (CodecEvent[M, T]) Encode

func (c CodecEvent[M, T]) Encode(obj swarm.Event[M, T]) ([]byte, error)

type CodecJson

type CodecJson[T any] struct{}

Json codec for I/O kernel

func NewCodecJson

func NewCodecJson[T any]() CodecJson[T]

func (CodecJson[T]) Decode

func (CodecJson[T]) Decode(b []byte) (x T, err error)

func (CodecJson[T]) Encode

func (CodecJson[T]) Encode(x T) ([]byte, error)

type CodecPacket

type CodecPacket struct{}

Encode Bytes as "JSON packet"

func NewCodecPacket

func NewCodecPacket() CodecPacket

func (CodecPacket) Decode

func (CodecPacket) Decode(x []byte) ([]byte, error)

func (CodecPacket) Encode

func (CodecPacket) Encode(x []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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