Documentation
¶
Index ¶
- type Bool
- type Bytes
- type Error
- type Flags32
- func (f *Flags32) CAS(cmp, swp bitutil.Flags32) bool
- func (f *Flags32) Get(bit uint8) bool
- func (f *Flags32) Load() bitutil.Flags32
- func (f *Flags32) Set(bit uint8) bool
- func (f *Flags32) Store(val bitutil.Flags32)
- func (f *Flags32) Swap(swp bitutil.Flags32) bitutil.Flags32
- func (f *Flags32) Unset(bit uint8) bool
- type Flags64
- func (f *Flags64) CAS(cmp, swp bitutil.Flags64) bool
- func (f *Flags64) Get(bit uint8) bool
- func (f *Flags64) Load() bitutil.Flags64
- func (f *Flags64) Set(bit uint8) bool
- func (f *Flags64) Store(val bitutil.Flags64)
- func (f *Flags64) Swap(swp bitutil.Flags64) bitutil.Flags64
- func (f *Flags64) Unset(bit uint8) bool
- type Int32
- type Int64
- type Interface
- type State
- type String
- type Time
- type Uint32
- type Uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool uint32
Bool provides user-friendly means of performing atomic operations on bool types.
func NewBool ¶
func NewBool() *Bool
NewBool will return a new Bool instance initialized with zero value.
func (*Bool) CAS ¶
CAS performs a compare-and-swap for a(n) bool value at address contained within i.
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
Bytes provides user-friendly means of performing atomic operations on []byte types.
func NewBytes ¶
func NewBytes() *Bytes
NewBytes will return a new Bytes instance initialized with zero value.
func (*Bytes) CAS ¶
CAS performs a compare-and-swap for a(n) []byte value at address contained within v.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error provides user-friendly means of performing atomic operations on error types.
func NewError ¶
func NewError() *Error
NewError will return a new Error instance initialized with zero value.
func (*Error) CAS ¶
CAS performs a compare-and-swap for a(n) error value at address contained within v.
type Flags32 ¶
type Flags32 bitutil.Flags32
Flags32 provides user-friendly means of performing atomic operations on bitutil.Flags32 types.
func NewFlags32 ¶
func NewFlags32() *Flags32
NewFlags32 will return a new Flags32 instance initialized with zero value.
func (*Flags32) CAS ¶
CAS performs a compare-and-swap for a(n) bitutil.Flags32 value at address contained within f.
func (*Flags32) Get ¶
Get will atomically load a(n) bitutil.Flags32 value contained within f, and check if bit value is set.
func (*Flags32) Load ¶
func (f *Flags32) Load() bitutil.Flags32
Load will atomically load bitutil.Flags32 value at address contained within f.
func (*Flags32) Set ¶
Set performs a compare-and-swap for a(n) bitutil.Flags32 with bit value set, at address contained within f.
func (*Flags32) Store ¶
func (f *Flags32) Store(val bitutil.Flags32)
Store will atomically store bitutil.Flags32 value in address contained within f.
type Flags64 ¶
type Flags64 bitutil.Flags64
Flags64 provides user-friendly means of performing atomic operations on bitutil.Flags64 types.
func NewFlags64 ¶
func NewFlags64() *Flags64
NewFlags64 will return a new Flags64 instance initialized with zero value.
func (*Flags64) CAS ¶
CAS performs a compare-and-swap for a(n) bitutil.Flags64 value at address contained within f.
func (*Flags64) Get ¶
Get will atomically load a(n) bitutil.Flags64 value contained within f, and check if bit value is set.
func (*Flags64) Load ¶
func (f *Flags64) Load() bitutil.Flags64
Load will atomically load bitutil.Flags64 value at address contained within f.
func (*Flags64) Set ¶
Set performs a compare-and-swap for a(n) bitutil.Flags64 with bit value set, at address contained within f.
func (*Flags64) Store ¶
func (f *Flags64) Store(val bitutil.Flags64)
Store will atomically store bitutil.Flags64 value in address contained within f.
type Int32 ¶
type Int32 int32
Int32 provides user-friendly means of performing atomic operations on int32 types.
func NewInt32 ¶
func NewInt32() *Int32
NewInt32 will return a new Int32 instance initialized with zero value.
func (*Int32) Add ¶
Add will atomically add int32 delta to value in address contained within i, returning new value.
func (*Int32) CAS ¶
CAS performs a compare-and-swap for a(n) int32 value at address contained within i.
type Int64 ¶
type Int64 int64
Int64 provides user-friendly means of performing atomic operations on int64 types.
func NewInt64 ¶
func NewInt64() *Int64
NewInt64 will return a new Int64 instance initialized with zero value.
func (*Int64) Add ¶
Add will atomically add int64 delta to value in address contained within i, returning new value.
func (*Int64) CAS ¶
CAS performs a compare-and-swap for a(n) int64 value at address contained within i.
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
Interface provides user-friendly means of performing atomic operations on interface{} types.
func NewInterface ¶
func NewInterface() *Interface
NewInterface will return a new Interface instance initialized with zero value.
func (*Interface) CAS ¶
CAS performs a compare-and-swap for a(n) interface{} value at address contained within v.
func (*Interface) Load ¶
func (v *Interface) Load() interface{}
Load will atomically load interface{} value at address contained within v.
type State ¶ added in v1.1.0
type State struct {
// contains filtered or unexported fields
}
State provides user-friendly means of performing atomic-like operations on a uint32 state, and allowing callbacks on successful state change. This is a bit of a misnomer being where it is, as it actually uses a mutex under-the-hood.
func (*State) CAS ¶ added in v1.1.0
CAS performs a compare-and-swap on State, calling fn on success. Success value is also returned.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String provides user-friendly means of performing atomic operations on string types.
func NewString ¶
func NewString() *String
NewString will return a new String instance initialized with zero value.
func (*String) CAS ¶
CAS performs a compare-and-swap for a(n) string value at address contained within v.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time provides user-friendly means of performing atomic operations on time.Time types.
func NewTime ¶
func NewTime() *Time
NewTime will return a new Time instance initialized with zero value.
func (*Time) CAS ¶
CAS performs a compare-and-swap for a(n) time.Time value at address contained within v.
type Uint32 ¶
type Uint32 uint32
Uint32 provides user-friendly means of performing atomic operations on uint32 types.
func NewUint32 ¶
func NewUint32() *Uint32
NewUint32 will return a new Uint32 instance initialized with zero value.
func (*Uint32) Add ¶
Add will atomically add uint32 delta to value in address contained within i, returning new value.
func (*Uint32) CAS ¶
CAS performs a compare-and-swap for a(n) uint32 value at address contained within i.
type Uint64 ¶
type Uint64 uint64
Uint64 provides user-friendly means of performing atomic operations on uint64 types.
func NewUint64 ¶
func NewUint64() *Uint64
NewUint64 will return a new Uint64 instance initialized with zero value.
func (*Uint64) Add ¶
Add will atomically add uint64 delta to value in address contained within i, returning new value.
func (*Uint64) CAS ¶
CAS performs a compare-and-swap for a(n) uint64 value at address contained within i.