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

encoder

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilPtr = errors.New("bencode: bencode doesn't have a nil type, nil ptr can't be encoded")
View Source
var ErrNilValue = errors.New("bencode: nil values cannot be encoded")

Functions

func AppendBytes added in v0.0.13

func AppendBytes(b []byte, value []byte) []byte

func AppendInt added in v0.0.13

func AppendInt(b []byte, v int64) []byte

func AppendStr added in v0.0.13

func AppendStr(b []byte, s string) []byte

func FreeCtx added in v0.0.8

func FreeCtx(ctx *Context)

func MarshalCtx added in v0.0.8

func MarshalCtx(ctx *Context, v any) error

Types

type Context

type Context struct {
	Buf []byte
	// contains filtered or unexported fields
}

func NewCtx added in v0.0.8

func NewCtx() *Context

type IsZeroValue added in v0.0.4

type IsZeroValue interface {
	IsZeroBencodeValue() bool
}

type Marshaler

type Marshaler interface {
	MarshalBencode() ([]byte, error)
}

type UnsupportedTypeAsMapKeyError

type UnsupportedTypeAsMapKeyError struct {
	Type reflect.Type
}

func (*UnsupportedTypeAsMapKeyError) Error

Jump to

Keyboard shortcuts

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