encoder

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 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")

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
}

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 UnsupportedInterfaceTypeError

type UnsupportedInterfaceTypeError struct {
	Type reflect.Type
}

func (*UnsupportedInterfaceTypeError) Error

type UnsupportedTypeAsMapKeyError

type UnsupportedTypeAsMapKeyError struct {
	Type reflect.Type
}

func (*UnsupportedTypeAsMapKeyError) Error

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
}

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

Jump to

Keyboard shortcuts

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