Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StoredCounter ¶
type StoredCounter struct {
// contains filtered or unexported fields
}
StoredCounter is a counter that persists to a datastore as it increments
func New ¶
func New(ds datastore.Datastore, name datastore.Key) *StoredCounter
New returns a new StoredCounter for the given datastore and key
func (*StoredCounter) Next ¶
func (sc *StoredCounter) Next() (uint64, error)
Next returns the next counter value, updating it on disk in the process if no counter is present, it creates one and returns a 0 value
Click to show internal directories.
Click to hide internal directories.