Versions in this module Expand all Collapse all v1 v1.0.1 May 8, 2026 Changes in this version + const DefaultDecodeMaxStrLen + func IsEmptyValue(v reflect.Value) bool + func Marshal(v any) ([]byte, error) + func MustMarshal(v any) []byte + func Unmarshal(data []byte, v any) (err error) + type Bytes []byte + func (me *Bytes) UnmarshalBencode(b []byte) error + func (me Bytes) GoString() string + func (me Bytes) MarshalBencode() ([]byte, error) + type Data map[string]any + func (this Data) GetAnnounce() string + func (this Data) GetComment() string + func (this Data) GetCreatedBy() string + func (this Data) GetCreationDate() int64 + func (this Data) GetCreationDateTime(tz ...string) time.Time + func (this Data) GetInfo() map[string]any + func (this Data) GetInfoItem(key string) any + func (this Data) GetInfoKeys() []string + func (this Data) GetItem(key string) any + func (this Data) GetItemInt64(key string) int64 + func (this Data) GetItemMap(key string) map[string]any + func (this Data) GetItemString(key string) string + func (this Data) GetKeys() []string + func (this Data) SetAnnounce(data string) Data + func (this Data) SetComment(data string) Data + func (this Data) SetCreatedBy(data string) Data + func (this Data) SetCreationDate(data int64) Data + func (this Data) SetCreationDateTime(t time.Time) Data + func (this Data) SetInfo(data map[string]any) Data + func (this Data) SetItem(key string, data any) Data + func (this Data) String() string + func (this Data) ToArray() map[string]any + func (this Data) ToInfoArray() map[string]any + func (this Data) ToInfoJSON() string + func (this Data) ToJSON() string + type Decoder struct + MaxStrLen MaxStrLen + Offset int64 + func NewDecoder(r io.Reader) *Decoder + func (d *Decoder) Decode(v any) (err error) + type Encoder struct + func NewEncoder(w io.Writer) *Encoder + func (e *Encoder) Encode(v any) (err error) + type FileInfo struct + Length int + Path string + type MarshalTypeError struct + Type reflect.Type + func (e *MarshalTypeError) Error() string + type Marshaler interface + MarshalBencode func() ([]byte, error) + type MarshalerError struct + Err error + Type reflect.Type + func (e *MarshalerError) Error() string + type MaxStrLen = int64 + type MultipleInfo struct + Files []MultipleInfoFile + Length int + Name string + NameUtf8 string + PieceLength int + Pieces string + func (this MultipleInfo) GetFileList() []FileInfo + func (this MultipleInfo) GetPieceHashes() ([][20]byte, error) + type MultipleInfoFile struct + Length int + Path []string + PathUtf8 string + type MultipleTorrent struct + Announce string + AnnounceList [][]string + Comment string + CommentUtf8 string + CreatDate int64 + CreatedBy string + Encoding string + Info MultipleInfo + Nodes [][]any + func (this MultipleTorrent) GetAnnounceList() []string + func (this MultipleTorrent) GetCreationDateTime(tz ...string) time.Time + func (this MultipleTorrent) GetInfoHash() ([20]byte, error) + func (this MultipleTorrent) GetInfoHashString() string + func (this MultipleTorrent) SetCreationDateTime(t time.Time) MultipleTorrent + type SingleInfo struct + Length int + MD5Sum string + Name string + NameUtf8 string + PieceLength int + Pieces string + Private bool + Publisher string + PublisherUrl string + PublisherUrlUtf8 string + PublisherUtf8 string + func (this SingleInfo) GetPieceHashes() ([][20]byte, error) + type SingleTorrent struct + Announce string + AnnounceList [][]string + Comment string + CommentUtf8 string + CreatDate int64 + CreatedBy string + Encoding string + Info SingleInfo + Nodes [][]any + func (this SingleTorrent) GetAnnounceList() []string + func (this SingleTorrent) GetCreationDateTime(tz ...string) time.Time + func (this SingleTorrent) GetInfoHash() ([20]byte, error) + func (this SingleTorrent) GetInfoHashString() string + func (this SingleTorrent) SetCreationDateTime(t time.Time) SingleTorrent + type SyntaxError struct + Offset int64 + What error + func (e *SyntaxError) Error() string + type UnmarshalFieldError struct + Field reflect.StructField + Key string + Type reflect.Type + func (e *UnmarshalFieldError) Error() string + type UnmarshalInvalidArgError struct + Type reflect.Type + func (e *UnmarshalInvalidArgError) Error() string + type UnmarshalTypeError struct + BencodeTypeName string + UnmarshalTargetType reflect.Type + func (e *UnmarshalTypeError) Error() string + type Unmarshaler interface + UnmarshalBencode func([]byte) error + type UnmarshalerError struct + Err error + Type reflect.Type + func (e *UnmarshalerError) Error() string + type UnusedTrailingBytesError struct + NumUnusedBytes int + func (me UnusedTrailingBytesError) Error() string