Documentation ¶
Index ¶
- type Counter
- func (c *Counter) Decrease(values ...uint64) error
- func (c *Counter) DecreaseAndRead(values ...uint64) (uint64, error)
- func (c *Counter) Format(f fmt.State, r rune)
- func (c *Counter) Increase(values ...uint64) error
- func (c *Counter) IncreaseAndRead(values ...uint64) (uint64, error)
- func (c *Counter) Read() uint64
- func (c *Counter) Set(value uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶ added in v0.10.0
NewCounter creates a new counter with the given initial value.
func (*Counter) DecreaseAndRead ¶
DecreaseAndRead decreases the counter by the given value (thread-safe) and returns the new value.
func (*Counter) IncreaseAndRead ¶
IncreaseAndRead increases the counter by the given value (thread-safe) and returns the new value.
Click to show internal directories.
Click to hide internal directories.