binstruct

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0, GPL-2.0, GPL-3.0-or-later, + 1 more Imports: 9 Imported by: 0

Documentation

Overview

Package binstruct implements simple struct-tag-based conversion between Go structures and binary on-disk representations of that data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(obj any) ([]byte, error)

func MarshalWithoutInterface

func MarshalWithoutInterface(obj any) ([]byte, error)

func StaticSize

func StaticSize(obj any) int

func Unmarshal

func Unmarshal(dat []byte, dstPtr any) (int, error)

func UnmarshalWithoutInterface

func UnmarshalWithoutInterface(dat []byte, dstPtr any) (int, error)

Types

type End

type End struct{}

type InvalidTypeError

type InvalidTypeError struct {
	Type reflect.Type
	Err  error
}

func (*InvalidTypeError) Error

func (e *InvalidTypeError) Error() string

func (*InvalidTypeError) Unwrap

func (e *InvalidTypeError) Unwrap() error

type MarshalError

type MarshalError struct {
	Type   reflect.Type
	Method string
	Err    error
}

func (*MarshalError) Error

func (e *MarshalError) Error() string

func (*MarshalError) Unwrap

func (e *MarshalError) Unwrap() error

type Marshaler

type Marshaler = encoding.BinaryMarshaler

type StaticSizer

type StaticSizer interface {
	BinaryStaticSize() int
}

type UnmarshalError

type UnmarshalError struct {
	Type   reflect.Type
	Method string
	Err    error
}

func (*UnmarshalError) Error

func (e *UnmarshalError) Error() string

func (*UnmarshalError) Unwrap

func (e *UnmarshalError) Unwrap() error

type Unmarshaler

type Unmarshaler interface {
	UnmarshalBinary([]byte) (int, error)
}

Directories

Path Synopsis
Package binutil provides utilities for implementing the interfaces consumed by binstruct.
Package binutil provides utilities for implementing the interfaces consumed by binstruct.

Jump to

Keyboard shortcuts

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