Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicTimestamp ¶
type AtomicTimestamp struct {
// contains filtered or unexported fields
}
AtomicTimestamp stores an atomic unix timestamp
func (*AtomicTimestamp) Load ¶
func (a *AtomicTimestamp) Load() UnixTimestamp
Load the timestamp atomically
func (*AtomicTimestamp) Remaining ¶
func (t *AtomicTimestamp) Remaining(lifetime time.Duration) time.Duration
Remaining time until expiration, considering the given lifetime
func (*AtomicTimestamp) Store ¶
func (a *AtomicTimestamp) Store(v UnixTimestamp)
Store the timestamp atomically
type Keeper ¶
type Keeper struct { CancelCtx context.Context CancelFunc context.CancelFunc Mutex sync.Mutex Group sync.WaitGroup // contains filtered or unexported fields }
Keeper base struct for objects that need a cancellable ticker thread
func (*Keeper) Clock ¶
func (t *Keeper) Clock() UnixTimestamp
Clock returns the current timestamp value
type UnixTimestamp ¶
type UnixTimestamp int64
UnixTimestamp defined to avoid having plain int64 type in APIs.
Click to show internal directories.
Click to hide internal directories.