import "github.com/anacrolix/torrent/bencode"
api.go bytes.go decode.go encode.go misc.go scanner.go tags.go
Marshal the value 'v' to the bencode form, return the result as []byte and an error if any.
Unmarshal the bencode value in the 'data' to a value pointed by the 'v' pointer, return a non-nil error if any.
type Decoder struct { // Sum of bytes used to Decode values. Offset int64 // contains filtered or unexported fields }
type Encoder struct {
// contains filtered or unexported fields
}
func (me ErrUnusedTrailingBytes) Error() string
In case if marshaler cannot encode a type, it will return this error. Typical example of such type is float32/float64 which has no bencode representation.
func (e *MarshalTypeError) Error() string
Any type which implements this interface, will be marshaled using the specified method.
A non-nil error was returned after calling MarshalBencode on a type which implements the Marshaler interface.
func (e *MarshalerError) Error() string
Malformed bencode input, unmarshaler failed to parse it.
func (e *SyntaxError) Error() string
Unmarshaler tried to write to an unexported (therefore unwritable) field.
func (e *UnmarshalFieldError) Error() string
Unmarshal argument must be a non-nil value of some pointer type.
func (e *UnmarshalInvalidArgError) Error() string
Unmarshaler spotted a value that was not appropriate for a given Go value.
func (e *UnmarshalTypeError) Error() string
Any type which implements this interface, will be unmarshaled using the specified method.
A non-nil error was returned after calling UnmarshalBencode on a type which implements the Unmarshaler interface.
func (e *UnmarshalerError) Error() string
Package bencode imports 14 packages (graph) and is imported by 99 packages. Updated 2020-02-20. Refresh now. Tools for package owners.