Documentation ¶
Index ¶
- Constants
- type AtomicCounter
- func (value *AtomicCounter) Add(u uint64) uint64
- func (value *AtomicCounter) CompareAndSwap(old, new uint64) bool
- func (value *AtomicCounter) Current() uint64
- func (value *AtomicCounter) Dec() uint64
- func (value *AtomicCounter) Inc() uint64
- func (value *AtomicCounter) Reset()
- func (value *AtomicCounter) String() string
- type AtomicTimeStamp
Constants ¶
View Source
const (
// DefaultSwapTries max tries for swaping timestamp
DefaultSwapTries = 100
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicCounter ¶
type AtomicCounter struct {
// contains filtered or unexported fields
}
AtomicCounter atomic integer counter
func (*AtomicCounter) CompareAndSwap ¶
func (value *AtomicCounter) CompareAndSwap(old, new uint64) bool
SwapAndCompare new value, returns false without updating to new value if old value no longer the same
func (*AtomicCounter) Current ¶
func (value *AtomicCounter) Current() uint64
Current value of counter
func (*AtomicCounter) String ¶
func (value *AtomicCounter) String() string
String representation of counter
type AtomicTimeStamp ¶
type AtomicTimeStamp struct {
// contains filtered or unexported fields
}
AtomicTimeStamp goroutine safe timestamp
func (*AtomicTimeStamp) SetIfNewer ¶
func (ats *AtomicTimeStamp) SetIfNewer(ts time.Time) error
SetIfNewer set new timestamp if new than current
func (*AtomicTimeStamp) SetIfOlder ¶
func (ats *AtomicTimeStamp) SetIfOlder(ts time.Time) error
SetIfOlder set new timestamp if older than current
Click to show internal directories.
Click to hide internal directories.