Categorygithub.com/zeebo/bencode
modulepackage
1.0.0
Repository: https://github.com/zeebo/bencode.git
Documentation: pkg.go.dev

# README

bencode

GoDoc Build Status Sourcegraph

Bencode is a library for encoding/decoding bencoded data into Go data structures. The api is designed to be similar to the JSON api in the Go standard library.

Documentation

Documentation at http://godoc.org/github.com/zeebo/bencode

# Functions

DecodeBytes reads the data in b and stores it into the value pointed to by val.
DecodeString reads the data in the string and stores it into the value pointed to by val.
EncodeBytes returns the bencoded data of val as a slice of bytes.
EncodeString returns the bencoded data of val as a string.
NewDecoder returns a new decoder that reads from r.
NewEncoder returns a new encoder that writes to w.

# Structs

A Decoder reads and decodes bencoded data from an input stream.
An Encoder writes bencoded objects to an output stream.

# Interfaces

Marshaler is the interface implemented by types that can marshal themselves into valid bencode.
Unmarshaler is the interface implemented by types that can unmarshal a bencode description of themselves.

# Type aliases

RawMessage is a special type that will store the raw bencode data when encoding or decoding.