package
module
Version:
v0.0.0-...-6419065
Opens a new window with list of versions in this module.
Published: Apr 3, 2016
License: BSD-2-Clause
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 18
Opens a new window with list of known importers.
README
¶
bencode
Package bencode implements bencoding of data as defined in BEP 3.
It uses type assertion over reflection for performance.
Documentation
Refer to the GoDoc.
Documentation
¶
Package bencode implements bencoding of data as defined in BEP 3 using
type assertion over reflection for performance.
Marshal returns the bencoding of v.
func Unmarshal(buf []byte) (interface{}, error)
Unmarshal deserializes and returns the bencoded value in buf.
A Decoder reads bencoded objects from an input stream.
NewDecoder returns a new decoder that reads from r.
Decode unmarshals the next bencoded value in the stream.
type Dict map[string]interface{}
Dict represents a bencode dictionary.
NewDict allocates the memory for a Dict.
An Encoder writes bencoded objects to an output stream.
NewEncoder returns a new encoder that writes to w.
Encode writes the bencoding of v to the stream.
List represents a bencode list.
NewList allocates the memory for a List.
type Marshaler interface {
MarshalBencode() ([]byte, error)
}
Marshaler is the interface implemented by objects that can marshal
themselves.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.