Documentation
¶
Index ¶
- Constants
- Variables
- func BucketIdForPeer(localPeer, remotePeer peer.ID) int16
- func ErrorStr(err error) *string
- func FmtPeerID(id peer.ID) string
- func NowPtr() *time.Time
- func StrPtr(str string) *string
- func TimeToStr(t *time.Time) *string
- func UniqueInt(input []int) *int
- func UniqueStr(input []string) *string
- type Content
Constants ¶
View Source
const (
DefaultBucketSize = 20
)
Variables ¶
View Source
var IDLength = 16
IDLength is here as a variable so that it can be decreased for tests with mocknet where IDs are way shorter. The call to FmtPeerID would panic if this value stayed at 16.
Functions ¶
func BucketIdForPeer ¶
Types ¶
type Content ¶
type Content struct { CID cid.Cid // contains filtered or unexported fields }
Content encapsulates multiple representations of the same data.
func NewRandomContent ¶
NewRandomContent reads 1024 bytes from crypto/rand and builds a content struct.
Click to show internal directories.
Click to hide internal directories.