Categorygithub.com/jackpal/bencode-go
modulepackage
1.0.2
Repository: https://github.com/jackpal/bencode-go.git
Documentation: pkg.go.dev

# README

bencode-go

A Go language binding for encoding and decoding data in the bencode format that is used by the BitTorrent peer-to-peer file sharing protocol.

Quick Start

Get the package

go get -u github.com/jackpal/bencode-go

Import the package

import bencode "github.com/jackpal/bencode-go"

Unmarshal a bencode stream into an object

data := myAwesomeObject{}
err := bencode.Unmarshal(reader, &data)

Decode a bencode stream

data, err := bencode.Decode(reader)

Encode an object into a bencode stream

err := bencode.Marshal(writer, data)

Complete documentation

http://godoc.org/github.com/jackpal/bencode-go

License

This project is licensed under the Go Authors standard license. (See the LICENSE file for details.)

Version History

tagNotes
v1.0.2Added go module.
v1.0.1Removed architecture specific test that was failing on ARM.
v1.0.0First version.

# Functions

Decode parses the stream r and returns the generic bencode object representation.
Marshal writes the bencode encoding of val to w.
Unmarshal reads and parses the bencode syntax data from r and fills in an arbitrary struct or slice pointed at by val.

# Structs

No description provided by the author

# Interfaces

Deprecated: This type is currently unused.