model

package
v0.0.0-...-9135dd4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2022 License: Zlib Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPostVersion = "1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	URL string `bencode:"bitchan-peer-url"`
}

Peer contains info about a peer

type PeerList

type PeerList struct {
	Peers map[string]Peer `bencode:"bitchan-peers"`
	Time  int64           `bencode:"bitchan-time"`
}

PeerList maps hostname to peer url

type Post

type Post struct {
	MetaInfoURL  string `bencode:"bitchan-metainfo-url"`
	MetaInfoHash string `bencode:"bitchan-infohash-hex",omit-empty`
	Version      string `bencode:"bitchan-version",omit-empty`
	PostedAt     int64  `bencode:"bitchan-posted-at"`
	PubKey       string `bencode:"bitchan-poster-pubkey"`
	Signature    string `bencode:"z",omit-empty`
}

func (*Post) ReadFromFile

func (p *Post) ReadFromFile(r io.Reader) error

func (*Post) Sign

func (p *Post) Sign(sk ed25519.PrivateKey)

func (*Post) ToInfo

func (p *Post) ToInfo() PostInfo

func (*Post) Verify

func (p *Post) Verify() bool

func (*Post) WriteToFile

func (p *Post) WriteToFile(w io.Writer) error

type PostInfo

type PostInfo struct {
	PostedAt int64  `json:"posted_at"`
	InfoHash string `json:"infohash_hex"`
	Name     string `json:"name",omit-empty`
}

type PostResponse

type PostResponse struct {
	Response string `bencode:"bitchan-post-response"`
	Version  string `bencode:"bitchan-version",omit-empty`
	Time     int64  `bencode:"bitchan-time"`
}

type ThreadInfo

type ThreadInfo struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL