Documentation
¶
Overview ¶
Package bencode implements bencoding of data as defined in BEP 3 using type assertion over reflection for performance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder reads bencoded objects from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
type Dict ¶
type Dict map[string]interface{}
Dict represents a bencode dictionary.
func (Dict) MarshalBencode ¶
MarshalBencode implements the Marshaler interface for Dict.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder writes bencoded objects to an output stream.
func NewEncoder ¶
NewEncoder returns a new encoder that writes to w.
type List ¶
type List []interface{}
List represents a bencode list.
func (List) MarshalBencode ¶
MarshalBencode implements the Marshaler interface for List.
Click to show internal directories.
Click to hide internal directories.