Documentation
¶
Index ¶
Constants ¶
View Source
const Type primitive.Type = "Counter"
Type is the counter type
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// GetCounter gets the Counter instance of the given name
GetCounter(ctx context.Context, name string) (Counter, error)
}
Client provides an API for creating Counters
type Counter ¶
type Counter interface {
primitive.Primitive
// Get gets the current value of the counter
Get(ctx context.Context) (int64, error)
// Set sets the value of the counter
Set(ctx context.Context, value int64) error
// Increment increments the counter by the given delta
Increment(ctx context.Context, delta int64) (int64, error)
// Decrement decrements the counter by the given delta
Decrement(ctx context.Context, delta int64) (int64, error)
}
Counter provides a distributed atomic counter
Click to show internal directories.
Click to hide internal directories.