Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpirationChecker ¶
type ExpirationChecker struct {
// contains filtered or unexported fields
}
ExpirationChecker is a tombstone source wrapper. It checks tombstones presence via tombstone source, caches it checks its expiration.
Must be created via NewChecker function. `var` and `ExpirationChecker{}` declarations leads to undefined behaviour and may lead to panics.
func NewChecker ¶
func NewChecker(oo ...Option) *ExpirationChecker
NewChecker creates, initializes and returns tombstone ExpirationChecker. The returned structure is ready to use.
Panics if any of the provided options does not allow constructing a valid tombstone ExpirationChecker.
func (*ExpirationChecker) IsTombstoneAvailable ¶
func (g *ExpirationChecker) IsTombstoneAvailable(ctx context.Context, a *addressSDK.Address, epoch uint64) bool
IsTombstoneAvailable checks the tombstone presence in the system in the following order:
- 1. Local LRU cache;
- 2. Tombstone source.
If a tombstone was successfully fetched (regardless of its expiration) it is cached in the LRU cache.
type Option ¶
type Option func(*cfg)
Option is an option of ExpirationChecker's constructor.
func WithCacheSize ¶
WithCacheSize returns an option to specify LRU cache size.
func WithLogger ¶
WithLogger returns an option to specify logger.
func WithTombstoneSource ¶
WithTombstoneSource returns an option to specify tombstone source.
type Source ¶
type Source interface { // Tombstone must return tombstone from the source it was // configured to fetch from and any error that appeared during // fetching process. // // Tombstone MUST return (nil, nil) if requested tombstone is // missing in the storage for the provided epoch. Tombstone(ctx context.Context, a *addressSDK.Address, epoch uint64) (*object.Object, error) }
Source is a tombstone source interface.