encoding

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes added in v0.21.0

type Bytes string

Identity encoding for bytes

func ForBytes added in v0.21.0

func ForBytes(cat string) Bytes

Create bytes identity codec

func (Bytes) Category added in v0.21.0

func (c Bytes) Category() string

func (Bytes) Decode added in v0.21.0

func (Bytes) Decode(bag swarm.Bag) ([]byte, error)

func (Bytes) Encode added in v0.21.0

func (c Bytes) Encode(x []byte) (swarm.Bag, error)

type Event added in v0.21.0

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

JSON encoding for events

func ForEvent added in v0.21.0

func ForEvent[E swarm.Event[M, T], M, T any](realm, agent string, category ...string) Event[M, T]

Creates JSON codec for events

func (Event[M, T]) Category added in v0.21.0

func (c Event[M, T]) Category() string

func (Event[M, T]) Decode added in v0.21.0

func (c Event[M, T]) Decode(bag swarm.Bag) (swarm.Event[M, T], error)

func (Event[M, T]) Encode added in v0.21.0

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

type Typed added in v0.21.0

type Typed[T any] string

JSON encoding for typed objects

func ForTyped added in v0.21.0

func ForTyped[T any](category ...string) Typed[T]

Create JSON codec for typed objects

func (Typed[T]) Category added in v0.21.0

func (c Typed[T]) Category() string

func (Typed[T]) Decode added in v0.21.0

func (Typed[T]) Decode(bag swarm.Bag) (x T, err error)

func (Typed[T]) Encode added in v0.21.0

func (c Typed[T]) Encode(obj T) (swarm.Bag, error)

Jump to

Keyboard shortcuts

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