package
0.1.4
Repository: https://github.com/uber/kraken.git
Documentation: pkg.go.dev

# Functions

CustomBlobFixture creates a BlobFixture with custom fields.
DeserializeMetaInfo reconstructs a MetaInfo from a json blob.
DigestFixture returns a random Digest.
DigestListFixture returns a list of random Digests.
HashedPeerID returns a PeerID derived from the hash of s.
InfoHashFixture returns a randomly generated InfoHash.
MetaInfoFixture returns a randomly generated MetaInfo.
NamespaceFixture creates a random namespace.
NewBlobFixture creates a randomly generated BlobFixture.
NewBlobInfo creates a new BlobInfo.
NewDigester instantiates and returns a new Digester object.
NewInfoHashFromBytes converts raw bytes to an InfoHash.
NewInfoHashFromHex converts a hexidemical string into an InfoHash.
NewMetaInfo creates a new MetaInfo.
NewPeerContext creates a new PeerContext.
NewPeerID parses a PeerID from the given string.
NewPeerInfo creates a new PeerInfo.
NewSHA256DigestFromHex constructs a Digest from a sha256 in hexadecimal format.
OriginContextFixture returns a randomly generated origin PeerContext.
OriginPeerInfoFixture returns a randomly generated PeerInfo for an origin.
ParseSHA256Digest parses a raw "<algo>:<hex>" sha256 digest.
PeerContextFixture returns a randomly generated PeerContext.
PeerIDFixture returns a randomly generated PeerID.
PeerInfoFixture returns a randomly generated PeerInfo.
PeerInfoFromContext derives PeerInfo from a PeerContext.
PieceHash returns the hash used to sum pieces.
RandomPeerID returns a randomly generated PeerID.
SizedBlobFixture creates a randomly generated BlobFixture of given size with given piece lengths.
SortedByPeerID returns a copy of peers which has been sorted by peer id.
TagFixture creates a random tag for service repo-bar.
ValidateSHA256 returns error if s is not a valid SHA256 hex digest.

# Constants

AddrHashPeerIDFactory creates peers ids based on a full "ip:port" address.
DigestEmptyTar is the sha256 digest of an empty tar file.
RandomPeerIDFactory creates random peer ids.
SHA256 is the only algorithm supported.

# Variables

ErrInvalidPeerIDLength returns when a string peer id does not decode into 20 bytes.

# Structs

BlobFixture joins all information associated with a blob for testing convenience.
BlobInfo contains metadata about a blob.
Digest can be represented in a string like "<algorithm>:<hex_digest_string>" Example: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
Digester calculates the digest of data stream.
MetaInfo contains torrent metadata.
PeerContext defines the context a peer runs within, namely the fields which are used to identify each peer.
PeerInfo defines peer metadata scoped to a torrent.
PeersByPeerID sorts PeerInfos by peer id.

# Type aliases

DigestList is a list of digests.
InfoHash is 20-byte SHA1 hash of the Info struct.
PeerID represents a fixed size peer id.
PeerIDFactory defines the method used to generate a peer id.
PeerInfos groups PeerInfo structs for sorting.