Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lemon-mint/gobe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

25 Commits

Repository files navigation

Go Binary Encoding

Code Generation based Go Type Serialization Library

Note: GOBE is still under active development.

Note: Circular reference is not supported.

Usage

buffer := make([]byte, obj.SizeGOBE())
obj.MarshalGOBE(buffer)

Installation

go install github.com/lemon-mint/gobe@latest

Tagged Union

type MyEnum struct {
 Type Type
 A *A `gobe_enum:"Type=AType"`
 B *B `gobe_enum:"Type=BType"`
 C *C `gobe_enum:"Type=CType"`
}

Ignored Field

type MyStruct struct {
 Name string
 Health CustomUint8
 Weapons []Weapon
 Conns []net.Conn `gobe:"-"` // ignored
}

Custom Marshaler/Unmarshaler

type GOBE_CUSTOM_TYPE interface {
 ZZMarshalGOBE(dst []byte) uint64
 ZZUnmarshalGOBE(src []byte) (offset uint64, ok bool)
 ZZSizeGOBE() uint64
}

About

GOBE: Go Binary Encoding

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /