Documentation ¶
Index ¶
- func FilterNew(ctx context.Context, revCache RevCache, revocations []*path_mgmt.RevInfo) ([]*path_mgmt.RevInfo, error)
- func NewCleaner(rc RevCache, s string) *cleaner.Cleaner
- func NoRevokedHopIntf(ctx context.Context, revCache RevCache, s *seg.PathSegment) (bool, error)
- func RelevantRevInfos(ctx context.Context, revCache RevCache, allSegs ...[]*seg.PathSegment) ([]*path_mgmt.RevInfo, error)
- type Key
- type KeySet
- type ResultChan
- type RevCache
- type RevOrErr
- type Revocations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterNew ¶ added in v0.3.1
func FilterNew(ctx context.Context, revCache RevCache, revocations []*path_mgmt.RevInfo) ([]*path_mgmt.RevInfo, error)
FilterNew filters the given revocations against the revCache, only the ones which are not in the cache are returned. This is a convenience wrapper around the Revocations type and its filter new method.
func NewCleaner ¶ added in v0.4.0
NewCleaner creates a cleaner task that deletes expired revocations.
func NoRevokedHopIntf ¶ added in v0.4.0
NoRevokedHopIntf returns true if there is no on-segment revocation.
func RelevantRevInfos ¶ added in v0.4.0
func RelevantRevInfos(ctx context.Context, revCache RevCache, allSegs ...[]*seg.PathSegment) ([]*path_mgmt.RevInfo, error)
RelevantRevInfos finds all revocations for the given segments.
Types ¶
type Key ¶
Key denotes the key for the revocation cache.
type ResultChan ¶ added in v0.4.0
type ResultChan <-chan RevOrErr
ResultChan is a channel of results.
type RevCache ¶
type RevCache interface { // Get items with the given keys from the cache. Returns all present requested items that are // not expired or an error if the query failed. Get(ctx context.Context, keys KeySet) (Revocations, error) // GetAll returns a channel that will provide all items in the revocation cache. If the cache // can't prepare the result channel a nil channel and the error are returned. If the querying // succeeded the channel will contain the revocations in the cache, or an error if the stored // data could not be parsed. Note that implementations can spawn a goroutine to fill the // channel, which means the channel must be fully drained to guarantee the destruction of the // goroutine. GetAll(ctx context.Context) (ResultChan, error) // Insert inserts or updates the given revocation into the cache. // Returns whether an insert was performed. Insert(ctx context.Context, rev *path_mgmt.RevInfo) (bool, error) // DeleteExpired deletes expired entries from the cache. // Users of the revcache should make sure to periodically call this method to prevent an // ever growing cache. // Returns the amount of deleted entries. DeleteExpired(ctx context.Context) (int64, error) db.LimitSetter io.Closer }
RevCache is a cache for revocations. Revcache implementations must be safe for concurrent usage.
type Revocations ¶ added in v0.4.0
Revocations is the map of revocations.
func RevocationToMap ¶ added in v0.4.0
func RevocationToMap(revs []*path_mgmt.RevInfo) (Revocations, error)
RevocationToMap converts a slice of revocations to a revocation map. If extracting the info field fails from a revocation, nil and the error is returned.
func (Revocations) FilterNew ¶ added in v0.4.0
func (r Revocations) FilterNew(ctx context.Context, revCache RevCache) error
FilterNew drops all revocations in r that are already in the revCache.
func (Revocations) Keys ¶ added in v0.4.0
func (r Revocations) Keys() KeySet
Keys returns the set of keys in this revocation map.
func (Revocations) ToSlice ¶ added in v0.4.0
func (r Revocations) ToSlice() []*path_mgmt.RevInfo
ToSlice extracts the values from this revocation map.
Directories ¶
Path | Synopsis |
---|---|
Package mock_revcache is a generated GoMock package.
|
Package mock_revcache is a generated GoMock package. |