Documentation ¶
Index ¶
- type ProviderRecord
- type ProviderStore
- func (pr *ProviderStore) AddProvider(key []byte, node string) error
- func (pr *ProviderStore) Contains(records []*ProviderRecord, node string) bool
- func (pr *ProviderStore) GetProvider(key []byte) ([]string, error)
- func (pr *ProviderStore) PruneOld()
- func (pr *ProviderStore) PruneWorker()
- func (pr *ProviderStore) UpdateTTL(records []*ProviderRecord, node string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderRecord ¶
type ProviderRecord struct { Key []byte // The Key pertaining to the Provider Record. Node string // The Node in Serialized Address format which is ready to provide that value AddedAt int64 // When was the provider record added. TTL int64 // TTL for the Provider Record. TTLUnit time.Duration // the Unit of TTL }
func NewProviderRecord ¶
func (*ProviderRecord) HasExpired ¶
func (pr *ProviderRecord) HasExpired() bool
HasExpired Is the ProviderRecord Expired
type ProviderStore ¶
type ProviderStore struct {
// contains filtered or unexported fields
}
func NewProviderStore ¶
func NewProviderStore(ttl int64, unit time.Duration) *ProviderStore
func (*ProviderStore) AddProvider ¶
func (pr *ProviderStore) AddProvider(key []byte, node string) error
func (*ProviderStore) Contains ¶
func (pr *ProviderStore) Contains(records []*ProviderRecord, node string) bool
func (*ProviderStore) GetProvider ¶
func (pr *ProviderStore) GetProvider(key []byte) ([]string, error)
func (*ProviderStore) PruneOld ¶
func (pr *ProviderStore) PruneOld()
func (*ProviderStore) PruneWorker ¶
func (pr *ProviderStore) PruneWorker()
func (*ProviderStore) UpdateTTL ¶
func (pr *ProviderStore) UpdateTTL(records []*ProviderRecord, node string)
Click to show internal directories.
Click to hide internal directories.