Documentation ¶
Index ¶
- type BlackListedPeer
- type CBORStorage
- func (bs *CBORStorage) AddOrUpdateKnown(known []KnownPeer, now time.Time) error
- func (bs *CBORStorage) AddSuspended(suspended []SuspendedPeer) error
- func (bs *CBORStorage) AddToBlackList(blackListed []BlackListedPeer) error
- func (bs *CBORStorage) BlackList(now time.Time) []BlackListedPeer
- func (bs *CBORStorage) DeleteBlackListedByIP(restricted []BlackListedPeer) error
- func (bs *CBORStorage) DeleteKnown(known []KnownPeer) error
- func (bs *CBORStorage) DeleteSuspendedByIP(suspended []SuspendedPeer) error
- func (bs *CBORStorage) DropBlackList() error
- func (bs *CBORStorage) DropKnown() error
- func (bs *CBORStorage) DropStorage() error
- func (bs *CBORStorage) DropSuspended() error
- func (bs *CBORStorage) IsBlackListedIP(ip IP, now time.Time) bool
- func (bs *CBORStorage) IsBlackListedIPs(ips []IP, now time.Time) []bool
- func (bs *CBORStorage) IsSuspendedIP(ip IP, now time.Time) bool
- func (bs *CBORStorage) IsSuspendedIPs(ips []IP, now time.Time) []bool
- func (bs *CBORStorage) Known(limit int) []KnownPeer
- func (bs *CBORStorage) RefreshBlackList(now time.Time) error
- func (bs *CBORStorage) RefreshSuspended(now time.Time) error
- func (bs *CBORStorage) Suspended(now time.Time) []SuspendedPeer
- type IP
- type KnownPeer
- type SuspendedPeer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlackListedPeer ¶ added in v0.10.2
type BlackListedPeer = restrictedPeer
func NewBlackListedPeer ¶ added in v0.10.2
type CBORStorage ¶ added in v0.9.0
type CBORStorage struct {
// contains filtered or unexported fields
}
func NewCBORStorage ¶ added in v0.9.0
func NewCBORStorage(baseDir string, now time.Time) (*CBORStorage, error)
func (*CBORStorage) AddOrUpdateKnown ¶ added in v0.10.0
func (bs *CBORStorage) AddOrUpdateKnown(known []KnownPeer, now time.Time) error
AddOrUpdateKnown adds known peers with now timestamp into peers storage with strong error guarantees.
func (*CBORStorage) AddSuspended ¶ added in v0.9.0
func (bs *CBORStorage) AddSuspended(suspended []SuspendedPeer) error
AddSuspended adds suspended peers into peers storage with strong error guarantees.
func (*CBORStorage) AddToBlackList ¶ added in v0.10.2
func (bs *CBORStorage) AddToBlackList(blackListed []BlackListedPeer) error
AddToBlackList adds suspended peers into peers storage with strong error guarantees.
func (*CBORStorage) BlackList ¶ added in v0.10.2
func (bs *CBORStorage) BlackList(now time.Time) []BlackListedPeer
func (*CBORStorage) DeleteBlackListedByIP ¶ added in v0.10.2
func (bs *CBORStorage) DeleteBlackListedByIP(restricted []BlackListedPeer) error
func (*CBORStorage) DeleteKnown ¶ added in v0.9.0
func (bs *CBORStorage) DeleteKnown(known []KnownPeer) error
DeleteKnown removes known peers from peers storage with strong error guarantees.
func (*CBORStorage) DeleteSuspendedByIP ¶ added in v0.9.0
func (bs *CBORStorage) DeleteSuspendedByIP(suspended []SuspendedPeer) error
DeleteSuspendedByIP removes suspended peers from peers storage with strong error guarantees. Note, that only IP field in input parameter will be used.
func (*CBORStorage) DropBlackList ¶ added in v0.10.2
func (bs *CBORStorage) DropBlackList() error
func (*CBORStorage) DropKnown ¶ added in v0.9.0
func (bs *CBORStorage) DropKnown() error
DropKnown clear known in memory cache and truncates known peers storage file with strong error guarantee.
func (*CBORStorage) DropStorage ¶ added in v0.9.0
func (bs *CBORStorage) DropStorage() error
DropStorage clear storage memory cache and truncates storage files. In case of error we can lose suspended peers storage file, but honestly it's almost impossible case.
func (*CBORStorage) DropSuspended ¶ added in v0.9.0
func (bs *CBORStorage) DropSuspended() error
DropSuspended clear suspended in memory cache and truncates suspended peers storage file with strong error guarantee.
func (*CBORStorage) IsBlackListedIP ¶ added in v0.10.2
func (bs *CBORStorage) IsBlackListedIP(ip IP, now time.Time) bool
func (*CBORStorage) IsBlackListedIPs ¶ added in v0.10.2
func (bs *CBORStorage) IsBlackListedIPs(ips []IP, now time.Time) []bool
func (*CBORStorage) IsSuspendedIP ¶ added in v0.9.0
func (bs *CBORStorage) IsSuspendedIP(ip IP, now time.Time) bool
func (*CBORStorage) IsSuspendedIPs ¶ added in v0.9.0
func (bs *CBORStorage) IsSuspendedIPs(ips []IP, now time.Time) []bool
func (*CBORStorage) Known ¶ added in v0.9.0
func (bs *CBORStorage) Known(limit int) []KnownPeer
func (*CBORStorage) RefreshBlackList ¶ added in v0.10.2
func (bs *CBORStorage) RefreshBlackList(now time.Time) error
func (*CBORStorage) RefreshSuspended ¶ added in v0.9.0
func (bs *CBORStorage) RefreshSuspended(now time.Time) error
RefreshSuspended removes expired peers from suspended peers storage with strong error guarantee.
func (*CBORStorage) Suspended ¶ added in v0.9.0
func (bs *CBORStorage) Suspended(now time.Time) []SuspendedPeer
type SuspendedPeer ¶ added in v0.9.0
type SuspendedPeer = restrictedPeer