Documentation ¶
Overview ¶
Package atomic provides simple wrappers around numerics to enforce atomic access.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool is an atomic Boolean.
func (*Bool) Swap ¶
Swap sets the given value and returns the previous value.
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration is an atomic wrapper around time.Duration https://godoc.org/time#Duration
func (*Duration) Add ¶
Add atomically adds to the wrapped time.Duration and returns the new value.
func (*Duration) CAS ¶
CAS is an atomic compare-and-swap.
func (*Duration) Load ¶
Load atomically loads the wrapped value.
func (*Duration) Store ¶
Store atomically stores the passed value.
func (*Duration) Sub ¶
Sub atomically subtracts from the wrapped time.Duration and returns the new value.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an atomic type-safe wrapper around Value for errors
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
Float64 is an atomic wrapper around float64.
func (*Float64) Add ¶
Add atomically adds to the wrapped float64 and returns the new value.
func (*Float64) CAS ¶
CAS is an atomic compare-and-swap.
func (*Float64) Store ¶
Store atomically stores the passed value.
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
Int32 is an atomic wrapper around an int32.
func (*Int32) Add ¶
Add atomically adds to the wrapped int32 and returns the new value.
func (*Int32) Dec ¶
Dec atomically decrements the wrapped int32 and returns the new value.
func (*Int32) Inc ¶
Inc atomically increments the wrapped int32 and returns the new value.
func (*Int32) Sub ¶
Sub atomically subtracts from the wrapped int32 and returns the new value.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 is an atomic wrapper around an int64.
func (*Int64) Add ¶
Add atomically adds to the wrapped int64 and returns the new value.
func (*Int64) Dec ¶
Dec atomically decrements the wrapped int64 and returns the new value.
func (*Int64) Inc ¶
Inc atomically increments the wrapped int64 and returns the new value.
func (*Int64) Sub ¶
Sub atomically subtracts from the wrapped int64 and returns the new value.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String is an atomic type-safe wrapper around Value for strings.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
Uint32 is an atomic wrapper around an uint32.
func (*Uint32) Add ¶
Add atomically adds to the wrapped uint32 and returns the new value.
func (*Uint32) Dec ¶
Dec atomically decrements the wrapped int32 and returns the new value.
func (*Uint32) Inc ¶
Inc atomically increments the wrapped uint32 and returns the new value.
func (*Uint32) Sub ¶
Sub atomically subtracts from the wrapped uint32 and returns the new value.
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
Uint64 is an atomic wrapper around a uint64.
func (*Uint64) Add ¶
Add atomically adds to the wrapped uint64 and returns the new value.
func (*Uint64) Dec ¶
Dec atomically decrements the wrapped uint64 and returns the new value.
func (*Uint64) Inc ¶
Inc atomically increments the wrapped uint64 and returns the new value.
func (*Uint64) Sub ¶
Sub atomically subtracts from the wrapped uint64 and returns the new value.
type Value ¶
Value shadows the type of the same name from sync/atomic https://godoc.org/sync/atomic#Value