proton

package module
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 23 Imported by: 6 modules, 37 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址