proton

package module
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 23 Imported by: 37

README

proton

Serialization library for go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBufferFailure = helpers.ErrBufferFailure

ErrBufferFailure means proton panicked because buffer was too small.

Functions

func Generate

func Generate(filePath string, msgs ...Msg)

Generate generates proton methods for provided types and stores them in a file.

Types

type Marshaller added in v0.4.1

type Marshaller interface {
	Messages() []any
	ID(msg any) (uint64, error)
	Size(msg any) (uint64, error)
	Marshal(msg any, buf []byte) (uint64, uint64, error)
	Unmarshal(id uint64, buf []byte) (any, uint64, error)
	IsPatchNeeded(msgDst, msgSrc any) (bool, error)
	MakePatch(msgDst, msgSrc any, buf []byte) (uint64, uint64, error)
	ApplyPatch(msg any, buf []byte) (uint64, error)
}

Marshaller is the interface implemented by marshallers.

type Msg added in v0.13.0

type Msg struct {
	MsgType      reflect.Type
	IgnoreFields map[string]bool
}

Msg represents message to generate code for.

func Message added in v0.4.0

func Message[T any](ignoreFields ...string) Msg

Message defines message to generate code for.

Jump to

Keyboard shortcuts

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