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

decoder

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte, v any) error

func UnmarshalRelaxed added in v0.1.0

func UnmarshalRelaxed(data []byte, v any) error

UnmarshalRelaxed is like Unmarshal but with relaxed parsing rules: - Dictionary keys are not required to be sorted - Duplicate dictionary keys are allowed (last value wins)

Types

type Context

type Context struct {
	Buf     []byte
	Relaxed bool
}

type Decoder

type Decoder interface {
	Decode(ctx *Context, cursor int, depth int64, rv reflect.Value) (int, error)
}

func CompileToGetDecoder

func CompileToGetDecoder(rt reflect.Type) (Decoder, error)

type Unmarshaler

type Unmarshaler interface {
	UnmarshalBencode([]byte) error
}

Jump to

Keyboard shortcuts

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