Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v3.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 5 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

func (*Buffer) WriteString added in v3.1.2

func (b *Buffer) WriteString(w io.Writer, s string) error

func (*Buffer) WriteUint64 added in v3.1.2

func (b *Buffer) WriteUint64(w io.Writer, value uint64, size int) 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