Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedOptimizedRevisions ¶
type CachedOptimizedRevisions struct {
// contains filtered or unexported fields
}
CachedOptimizedRevisions does caching and deduplication for requests for optimized revisions.
func NewCachedOptimizedRevisions ¶
func NewCachedOptimizedRevisions(maxRevisionStaleness time.Duration) *CachedOptimizedRevisions
NewCachedOptimizedRevisions returns a CachedOptimizedRevisions for the given configuration
func (*CachedOptimizedRevisions) OptimizedRevision ¶
func (*CachedOptimizedRevisions) SetOptimizedRevisionFunc ¶
func (cor *CachedOptimizedRevisions) SetOptimizedRevisionFunc(revisionFunc OptimizedRevisionFunction)
SetOptimizedRevisionFunc must be called after construction, and is the method by which one specializes this helper for a specific datastore.
type OptimizedRevisionFunction ¶
type OptimizedRevisionFunction func(context.Context) (rev datastore.Revision, validFor time.Duration, err error)
OptimizedRevisionFunction instructs the datastore to compute its own current optimized revision given the specific quantization, and return for how long it will remain valid.
type RemoteClockRevisions ¶
type RemoteClockRevisions struct { *CachedOptimizedRevisions // contains filtered or unexported fields }
RemoteClockRevisions handles revision calculation for datastores that provide their own clocks.
func NewRemoteClockRevisions ¶
func NewRemoteClockRevisions(gcWindow, maxRevisionStaleness, followerReadDelay, quantization time.Duration) *RemoteClockRevisions
NewRemoteClockRevisions returns a RemoteClockRevisions for the given configuration
func (*RemoteClockRevisions) CheckRevision ¶
func (*RemoteClockRevisions) SetNowFunc ¶
func (rcr *RemoteClockRevisions) SetNowFunc(nowFunc RemoteNowFunction)
SetNowFunc sets the function used to determine the head revision