jsoncodec

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec[K eventsourcing.ID] struct {
	// contains filtered or unexported fields
}

func New

func New[K eventsourcing.ID]() *Codec[K]

func (Codec[K]) Decode

func (j Codec[K]) Decode(data []byte, meta eventsourcing.DecoderMeta[K]) (eventsourcing.Kinder, error)

func (Codec[K]) Encode

func (Codec[K]) Encode(v eventsourcing.Kinder) ([]byte, error)

func (*Codec[K]) RegisterFactory

func (j *Codec[K]) RegisterFactory(kind eventsourcing.Kind, factory Factory[K])

func (*Codec[K]) RegisterUpcaster

func (j *Codec[K]) RegisterUpcaster(kind eventsourcing.Kind, upcaster Upcaster)

type Factory added in v0.37.0

type Factory[K eventsourcing.ID] func(id K) eventsourcing.Kinder

type Upcaster

type Upcaster func(t eventsourcing.Kinder) (eventsourcing.Kinder, error)

Jump to

Keyboard shortcuts

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