Documentation
¶
Overview ¶
Package gtype provides kinds of high performance and concurrent-safe basic variable types.
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
}
func NewBool ¶
NewBool returns a concurrent-safe object for bool type, with given initial value <value>.
func (*Bool) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Bool) Clone ¶
Clone clones and returns a new concurrent-safe object for bool type.
func (*Bool) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Byte ¶
type Byte struct {
// contains filtered or unexported fields
}
func NewByte ¶
NewByte returns a concurrent-safe object for byte type, with given initial value <value>.
func (*Byte) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Byte) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Byte) Clone ¶
Clone clones and returns a new concurrent-safe object for byte type.
func (*Byte) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
func NewBytes ¶
NewBytes returns a concurrent-safe object for []byte type, with given initial value <value>.
func (*Bytes) Clone ¶
Clone clones and returns a new concurrent-safe object for []byte type.
func (*Bytes) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value. Note: The parameter <value> cannot be nil.
type Float32 ¶
type Float32 struct {
// contains filtered or unexported fields
}
func NewFloat32 ¶
NewFloat32 returns a concurrent-safe object for float32 type, with given initial value <value>.
func (*Float32) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Float32) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Float32) Clone ¶
Clone clones and returns a new concurrent-safe object for float32 type.
func (*Float32) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
func NewFloat64 ¶
NewFloat64 returns a concurrent-safe object for float64 type, with given initial value <value>.
func (*Float64) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Float64) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Float64) Clone ¶
Clone clones and returns a new concurrent-safe object for float64 type.
func (*Float64) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
func NewInt ¶
NewInt returns a concurrent-safe object for int type, with given initial value <value>.
func (*Int) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Int) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Int) Clone ¶
Clone clones and returns a new concurrent-safe object for int type.
func (*Int) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
func NewInt32 ¶
NewInt32 returns a concurrent-safe object for int32 type, with given initial value <value>.
func (*Int32) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Int32) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Int32) Clone ¶
Clone clones and returns a new concurrent-safe object for int32 type.
func (*Int32) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
func NewInt64 ¶
NewInt64 returns a concurrent-safe object for int64 type, with given initial value <value>.
func (*Int64) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Int64) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Int64) Clone ¶
Clone clones and returns a new concurrent-safe object for int64 type.
func (*Int64) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
func NewInterface ¶
func NewInterface(value ...interface{}) *Interface
NewInterface returns a concurrent-safe object for interface{} type, with given initial value <value>.
func (*Interface) Clone ¶
Clone clones and returns a new concurrent-safe object for interface{} type.
type String ¶
type String struct {
// contains filtered or unexported fields
}
func NewString ¶
NewString returns a concurrent-safe object for string type, with given initial value <value>.
func (*String) Clone ¶
Clone clones and returns a new concurrent-safe object for string type.
func (*String) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
func NewUint ¶
NewUint returns a concurrent-safe object for uint type, with given initial value <value>.
func (*Uint) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Uint) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Uint) Clone ¶
Clone clones and returns a new concurrent-safe object for uint type.
func (*Uint) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
func NewUint32 ¶
NewUint32 returns a concurrent-safe object for uint32 type, with given initial value <value>.
func (*Uint32) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Uint32) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Uint32) Clone ¶
Clone clones and returns a new concurrent-safe object for uint32 type.
func (*Uint32) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
func NewUint64 ¶
NewUint64 returns a concurrent-safe object for uint64 type, with given initial value <value>.
func (*Uint64) Add ¶
Add atomically adds <delta> to t.value and returns the new value.
func (*Uint64) Cas ¶
Cas executes the compare-and-swap operation for value.
func (*Uint64) Clone ¶
Clone clones and returns a new concurrent-safe object for uint64 type.
func (*Uint64) Set ¶
Set atomically stores <value> into t.value and returns the previous value of t.value.