Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr2Peers ¶
type Addr2Peers struct {
// contains filtered or unexported fields
}
Active peers
func NewAddr2Peers ¶
func NewAddr2Peers() *Addr2Peers
func (*Addr2Peers) Add ¶
func (a *Addr2Peers) Add(address string, peer peer.Peer)
add address to known list
func (*Addr2Peers) Each ¶
func (a *Addr2Peers) Each(f func(p peer.Peer))
execute function with each address
func (*Addr2Peers) Exists ¶
func (a *Addr2Peers) Exists(address string) bool
check address already exists
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶
func NewCounter() *Counter
func (*Counter) IncEachTransaction ¶
func (a *Counter) IncEachTransaction()
collect how many transaction we send (or tried to send) in an hour
func (*Counter) IncUniqueTransaction ¶
func (a *Counter) IncUniqueTransaction()
collect how many unique transaction we received
type FileBasedStorage ¶
type FileBasedStorage struct {
// contains filtered or unexported fields
}
func NewFileBasedStorage ¶
func NewFileBasedStorage(fs afero.Fs, pathToFile string) (*FileBasedStorage, error)
func (*FileBasedStorage) Close ¶
func (a *FileBasedStorage) Close()
func (*FileBasedStorage) Read ¶
func (a *FileBasedStorage) Read() ([]byte, error)
func (*FileBasedStorage) Save ¶
func (a *FileBasedStorage) Save(b []byte) error
type JsonKnowPeerRow ¶
type KnownPeers ¶
type KnownPeers struct {
// contains filtered or unexported fields
}
func NewKnownPeers ¶
func NewKnownPeers(storage Storage) (*KnownPeers, error)
func NewKnownPeersInterval ¶
func NewKnownPeersInterval(storage Storage, saveInterval time.Duration) (*KnownPeers, error)
func (*KnownPeers) Addresses ¶
func (a *KnownPeers) Addresses() []proto.PeerInfo
func (*KnownPeers) GetAll ¶
func (a *KnownPeers) GetAll() []string
func (*KnownPeers) Stop ¶
func (a *KnownPeers) Stop()
type NoOnStorage ¶
type NoOnStorage struct{}
func (NoOnStorage) Close ¶
func (a NoOnStorage) Close()
func (NoOnStorage) Read ¶
func (a NoOnStorage) Read() ([]byte, error)
func (NoOnStorage) Save ¶
func (a NoOnStorage) Save(_ []byte) error
type SpawnedPeers ¶
type SpawnedPeers struct {
// contains filtered or unexported fields
}
func NewSpawnedPeers ¶
func NewSpawnedPeers() *SpawnedPeers
func (*SpawnedPeers) Add ¶
func (a *SpawnedPeers) Add(addr string)
func (*SpawnedPeers) Delete ¶
func (a *SpawnedPeers) Delete(addr string)
func (*SpawnedPeers) Exists ¶
func (a *SpawnedPeers) Exists(addr string) bool
func (*SpawnedPeers) GetAll ¶
func (a *SpawnedPeers) GetAll() []string
Click to show internal directories.
Click to hide internal directories.