package
2.0.0-alpha+incompatible
Repository: https://github.com/leighmacdonald/mika.git
Documentation: pkg.go.dev

# Packages

Package http defines a storage backend over a HTTP API.
No description provided by the author
Package mysql provides mysql/mariadb backed persistent storage NOTE this requires MySQL 8.0+ / MariaDB 10.5+ (maybe 10.4?) due to the POINT column type.
Package postgres provides the backing store for postgresql TODO create domains for the uint types, eg: create domain uint64 as numeric(20,0);.
No description provided by the author

# Functions

AddPeerDriver will register a new driver able to instantiate a PeerStore.
AddTorrentDriver will register a new driver able to instantiate a TorrentStore.
AddUserDriver will register a new driver able to instantiate a UserStore.
GenerateTestPeer creates a peer using fake data for the provided user.
GenerateTestTorrent creates a torrent using fake data.
GenerateTestUser creates a peer using fake data.
InfoHashFromBytes returns a binary infohash from a byte array.
InfoHashFromHex returns a binary infohash from a byte array.
InfoHashFromString returns a binary infohash from the info string.
NewPeer create a new peer instance for inserting into a swarm.
No description provided by the author
NewPeerHash created a new PeerHash from the existing infohash and peer_id.
NewPeerStore will attempt to initialize a PeerStore using the driver name provided.
NewSwarm instantiates a new swarm.
NewTorrent allocates and returns a new Torrent instance pointer with all the minimum value required to operated in place.
NewTorrentCache configures and returns a new instance of TorrentCache.
NewTorrentStore will attempt to initialize a TorrentStore using the driver name provided.
No description provided by the author
NewUserStore will attempt to initialize a UserStore using the driver name provided.
PeerHashFromHex returns a binary infohash from a byte array.
PeerIDFromString translates a string into a binary PeerID.
TestPeerStore tests the interface implementation.
TestTorrentStore tests the interface implementation.
TestUserStore tests the user store for conformance to our interface.

# Structs

Peer represents a single unique peer in a swarm.
No description provided by the author
PeerStats is any info to batch peer updates.
Swarm is a set of users participating in a torrent.
Torrent is the core struct for our torrent being tracked.
TorrentCache is a simple (dumb) in-memory cache for torrent items.
TorrentStats is used to relay info stats for a torrent around.
No description provided by the author
UpdateState is used to store temporary data used for batch updates.
User defines a basic user known to the tracker All users are considered enabled if they exist.
No description provided by the author
UserStats is any info we want to batch update for a user.
WhiteListClient defines a whitelisted bittorrent client allowed to participate in swarms.

# Interfaces

PeerDriver provides a interface to enable registration of PeerStore drivers.
PeerStore defines our interface for storing peer data This doesnt need to be persisted to disk, but it will help warm up times if its backed by something that can restore its in memory state, such as redis.
TorrentDriver provides a interface to enable registration of TorrentStore drivers.
TorrentStore defines where we can store permanent torrent data The backing drivers should always persist the data to disk.
UserDriver provides a interface to enable registration of UserStore drivers.
UserStore defines a interface used to retrieve user data from a backing store.

# Type aliases

InfoHash is a unique 20byte identifier for a torrent.
PeerHash is a merger of the infohash and peer_id, used for simpler map lookups.
PeerID is the client supplied unique identifier for a peer.
Torrents is a basic type alias for multiple torrents.
Users is a slice of known users.