common

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutBuffer

func PutBuffer(buf *Buffer)

Types

type Buffer

type Buffer struct {
	Data []byte
	B1   []byte
	B2   []byte
	B4   []byte
	B8   []byte
	B16  []byte
	// contains filtered or unexported fields
}

func GetBuffer

func GetBuffer() *Buffer

func (*Buffer) Flush

func (b *Buffer) Flush(w io.Writer) error

func (*Buffer) Write

func (b *Buffer) Write(w io.Writer, vs ...byte) error

type Common

type Common struct {
}

Common is used encoding/decoding

func (*Common) CheckField

func (c *Common) CheckField(field reflect.StructField) (public, omit bool, name string)

CheckField returns flag whether should encode/decode or not and field name

func (*Common) CollectFields added in v3.1.0

func (c *Common) CollectFields(t reflect.Type, path []int) []FieldInfo

CollectFields collects all fields from a struct, expanding embedded structs following the same rules as encoding/json

type FieldInfo added in v3.1.0

type FieldInfo struct {
	Path      []int   // path to reach this field (indices for embedded structs)
	Name      string  // field name or tag
	Omit      bool    // omitempty flag
	Tagged    bool    // tag name explicitly set
	OmitPaths [][]int // paths to embedded fields with omitempty
}

FieldInfo holds information about a struct field including its path for embedded structs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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