Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PersistentAutoDecrementCounter ¶
type PersistentAutoDecrementCounter struct {
// contains filtered or unexported fields
}
PersistentAutoDecrementCounter is an AutoDecrementCounter which uses a file in GCS to persist its value between program restarts.
func NewPersistentAutoDecrementCounter ¶
func NewPersistentAutoDecrementCounter(ctx context.Context, gcsClient gcs.GCSClient, path string, d time.Duration) (*PersistentAutoDecrementCounter, error)
NewPersistentAutoDecrementCounter returns a PersistentAutoDecrementCounter instance using the given file.
func (*PersistentAutoDecrementCounter) Get ¶
func (c *PersistentAutoDecrementCounter) Get() int64
Get returns the current value of the PersistentAutoDecrementCounter.
func (*PersistentAutoDecrementCounter) GetDecrementTimes ¶
func (c *PersistentAutoDecrementCounter) GetDecrementTimes() []time.Time
GetDecrementTimes returns a slice of time.Time which indicate *roughly* when the counter will be decremented. This is informational only, and the caller should not rely on the times to be perfectly accurate.
Click to show internal directories.
Click to hide internal directories.