internal

package
v0.33.36-update-commit Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerIdCache

type PeerIdCache struct {
	// contains filtered or unexported fields
}

func NewPeerIdCache

func NewPeerIdCache(size int) (*PeerIdCache, error)

func (*PeerIdCache) ByPeerId

func (p *PeerIdCache) ByPeerId(pid peer.ID) (string, bool)

ByPeerId returns the base58 encoded peer id string by directly looking up the peer id in the cache. It is only used for testing and since this is an internal package, it is not exposed to the outside world.

func (*PeerIdCache) PeerIdString

func (p *PeerIdCache) PeerIdString(pid peer.ID) string

PeerIdString returns the base58 encoded peer id string, it looks up the peer id in a cache to avoid expensive base58 encoding, and caches the result for future use in case of a cache miss. It is safe to call this method concurrently.

func (*PeerIdCache) Size

func (p *PeerIdCache) Size() int

Size returns the number of entries in the cache; it is mainly used for testing.

Jump to

Keyboard shortcuts

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