codecguard

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package codecguard contains the panic boundary for application-provided element codecs. Codec implementations are extension code: a panic must not escape a CRDT encode or decode operation and terminate the host process.

Index

Constants

This section is empty.

Variables

View Source
var ErrPanic = errors.New("codec: panic")

ErrPanic reports that an application-provided codec panicked. It deliberately does not retain or format the recovered value, which can contain application data and is not safe to expose from a library boundary.

Functions

func ID

func ID(call func() string) (id string, err error)

ID invokes an element codec identifier without allowing a panic to escape.

func Marshal

func Marshal(call func() ([]byte, error)) (encoded []byte, err error)

Marshal invokes an element codec encoder without allowing a panic to escape.

func Unmarshal

func Unmarshal[T any](call func() (T, error)) (value T, err error)

Unmarshal invokes an element codec decoder without allowing a panic to escape.

Types

This section is empty.

Jump to

Keyboard shortcuts

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