gf: github.com/gogf/gf/g/container/gtype Index | Files

package gtype

import "github.com/gogf/gf/g/container/gtype"

Package gtype provides kinds of high performance and concurrent-safe basic variable types.

Index

Package Files

bool.go byte.go bytes.go float32.go float64.go gtype.go int.go int32.go int64.go interface.go string.go uint.go uint32.go uint64.go

type Bool Uses

type Bool struct {
    // contains filtered or unexported fields
}

func NewBool Uses

func NewBool(value ...bool) *Bool

NewBool returns a concurrent-safe object for bool type, with given initial value <value>.

func (*Bool) Cas Uses

func (v *Bool) Cas(old, new bool) bool

Cas executes the compare-and-swap operation for value.

func (*Bool) Clone Uses

func (v *Bool) Clone() *Bool

Clone clones and returns a new concurrent-safe object for bool type.

func (*Bool) Set Uses

func (v *Bool) Set(value bool) (old bool)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Bool) Val Uses

func (v *Bool) Val() bool

Val atomically loads t.valueue.

type Byte Uses

type Byte struct {
    // contains filtered or unexported fields
}

func NewByte Uses

func NewByte(value ...byte) *Byte

NewByte returns a concurrent-safe object for byte type, with given initial value <value>.

func (*Byte) Add Uses

func (v *Byte) Add(delta byte) (new byte)

Add atomically adds <delta> to t.value and returns the new value.

func (*Byte) Cas Uses

func (v *Byte) Cas(old, new byte) bool

Cas executes the compare-and-swap operation for value.

func (*Byte) Clone Uses

func (v *Byte) Clone() *Byte

Clone clones and returns a new concurrent-safe object for byte type.

func (*Byte) Set Uses

func (v *Byte) Set(value byte) (old byte)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Byte) Val Uses

func (v *Byte) Val() byte

Val atomically loads t.value.

type Bytes Uses

type Bytes struct {
    // contains filtered or unexported fields
}

func NewBytes Uses

func NewBytes(value ...[]byte) *Bytes

NewBytes returns a concurrent-safe object for []byte type, with given initial value <value>.

func (*Bytes) Clone Uses

func (v *Bytes) Clone() *Bytes

Clone clones and returns a new concurrent-safe object for []byte type.

func (*Bytes) Set Uses

func (v *Bytes) Set(value []byte) (old []byte)

Set atomically stores <value> into t.value and returns the previous value of t.value. Note: The parameter <value> cannot be nil.

func (*Bytes) Val Uses

func (v *Bytes) Val() []byte

Val atomically loads t.value.

type Float32 Uses

type Float32 struct {
    // contains filtered or unexported fields
}

func NewFloat32 Uses

func NewFloat32(value ...float32) *Float32

NewFloat32 returns a concurrent-safe object for float32 type, with given initial value <value>.

func (*Float32) Add Uses

func (v *Float32) Add(delta float32) (new float32)

Add atomically adds <delta> to t.value and returns the new value.

func (*Float32) Cas Uses

func (v *Float32) Cas(old, new float32) bool

Cas executes the compare-and-swap operation for value.

func (*Float32) Clone Uses

func (v *Float32) Clone() *Float32

Clone clones and returns a new concurrent-safe object for float32 type.

func (*Float32) Set Uses

func (v *Float32) Set(value float32) (old float32)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Float32) Val Uses

func (v *Float32) Val() float32

Val atomically loads t.value.

type Float64 Uses

type Float64 struct {
    // contains filtered or unexported fields
}

func NewFloat64 Uses

func NewFloat64(value ...float64) *Float64

NewFloat64 returns a concurrent-safe object for float64 type, with given initial value <value>.

func (*Float64) Add Uses

func (v *Float64) Add(delta float64) (new float64)

Add atomically adds <delta> to t.value and returns the new value.

func (*Float64) Cas Uses

func (v *Float64) Cas(old, new float64) bool

Cas executes the compare-and-swap operation for value.

func (*Float64) Clone Uses

func (v *Float64) Clone() *Float64

Clone clones and returns a new concurrent-safe object for float64 type.

func (*Float64) Set Uses

func (v *Float64) Set(value float64) (old float64)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Float64) Val Uses

func (v *Float64) Val() float64

Val atomically loads t.value.

type Int Uses

type Int struct {
    // contains filtered or unexported fields
}

func NewInt Uses

func NewInt(value ...int) *Int

NewInt returns a concurrent-safe object for int type, with given initial value <value>.

func (*Int) Add Uses

func (v *Int) Add(delta int) (new int)

Add atomically adds <delta> to t.value and returns the new value.

func (*Int) Cas Uses

func (v *Int) Cas(old, new int) bool

Cas executes the compare-and-swap operation for value.

func (*Int) Clone Uses

func (v *Int) Clone() *Int

Clone clones and returns a new concurrent-safe object for int type.

func (*Int) Set Uses

func (v *Int) Set(value int) (old int)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Int) Val Uses

func (v *Int) Val() int

Val atomically loads t.value.

type Int32 Uses

type Int32 struct {
    // contains filtered or unexported fields
}

func NewInt32 Uses

func NewInt32(value ...int32) *Int32

NewInt32 returns a concurrent-safe object for int32 type, with given initial value <value>.

func (*Int32) Add Uses

func (v *Int32) Add(delta int32) (new int32)

Add atomically adds <delta> to t.value and returns the new value.

func (*Int32) Cas Uses

func (v *Int32) Cas(old, new int32) bool

Cas executes the compare-and-swap operation for value.

func (*Int32) Clone Uses

func (v *Int32) Clone() *Int32

Clone clones and returns a new concurrent-safe object for int32 type.

func (*Int32) Set Uses

func (v *Int32) Set(value int32) (old int32)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Int32) Val Uses

func (v *Int32) Val() int32

Val atomically loads t.value.

type Int64 Uses

type Int64 struct {
    // contains filtered or unexported fields
}

func NewInt64 Uses

func NewInt64(value ...int64) *Int64

NewInt64 returns a concurrent-safe object for int64 type, with given initial value <value>.

func (*Int64) Add Uses

func (v *Int64) Add(delta int64) (new int64)

Add atomically adds <delta> to t.value and returns the new value.

func (*Int64) Cas Uses

func (v *Int64) Cas(old, new int64) bool

Cas executes the compare-and-swap operation for value.

func (*Int64) Clone Uses

func (v *Int64) Clone() *Int64

Clone clones and returns a new concurrent-safe object for int64 type.

func (*Int64) Set Uses

func (v *Int64) Set(value int64) (old int64)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Int64) Val Uses

func (v *Int64) Val() int64

Val atomically loads t.value.

type Interface Uses

type Interface struct {
    // contains filtered or unexported fields
}

func NewInterface Uses

func NewInterface(value ...interface{}) *Interface

NewInterface returns a concurrent-safe object for interface{} type, with given initial value <value>.

func (*Interface) Clone Uses

func (v *Interface) Clone() *Interface

Clone clones and returns a new concurrent-safe object for interface{} type.

func (*Interface) Set Uses

func (v *Interface) Set(value interface{}) (old interface{})

Set atomically stores <value> into t.value and returns the previous value of t.value. Note: The parameter <value> cannot be nil.

func (*Interface) Val Uses

func (v *Interface) Val() interface{}

Val atomically loads t.value.

type String Uses

type String struct {
    // contains filtered or unexported fields
}

func NewString Uses

func NewString(value ...string) *String

NewString returns a concurrent-safe object for string type, with given initial value <value>.

func (*String) Clone Uses

func (v *String) Clone() *String

Clone clones and returns a new concurrent-safe object for string type.

func (*String) Set Uses

func (v *String) Set(value string) (old string)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*String) Val Uses

func (v *String) Val() string

Val atomically loads t.value.

type Type Uses

type Type = Interface

func New Uses

func New(value ...interface{}) *Type

See NewInterface.

type Uint Uses

type Uint struct {
    // contains filtered or unexported fields
}

func NewUint Uses

func NewUint(value ...uint) *Uint

NewUint returns a concurrent-safe object for uint type, with given initial value <value>.

func (*Uint) Add Uses

func (v *Uint) Add(delta uint) (new uint)

Add atomically adds <delta> to t.value and returns the new value.

func (*Uint) Cas Uses

func (v *Uint) Cas(old, new uint) bool

Cas executes the compare-and-swap operation for value.

func (*Uint) Clone Uses

func (v *Uint) Clone() *Uint

Clone clones and returns a new concurrent-safe object for uint type.

func (*Uint) Set Uses

func (v *Uint) Set(value uint) (old uint)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Uint) Val Uses

func (v *Uint) Val() uint

Val atomically loads t.value.

type Uint32 Uses

type Uint32 struct {
    // contains filtered or unexported fields
}

func NewUint32 Uses

func NewUint32(value ...uint32) *Uint32

NewUint32 returns a concurrent-safe object for uint32 type, with given initial value <value>.

func (*Uint32) Add Uses

func (v *Uint32) Add(delta uint32) (new uint32)

Add atomically adds <delta> to t.value and returns the new value.

func (*Uint32) Cas Uses

func (v *Uint32) Cas(old, new uint32) bool

Cas executes the compare-and-swap operation for value.

func (*Uint32) Clone Uses

func (v *Uint32) Clone() *Uint32

Clone clones and returns a new concurrent-safe object for uint32 type.

func (*Uint32) Set Uses

func (v *Uint32) Set(value uint32) (old uint32)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Uint32) Val Uses

func (v *Uint32) Val() uint32

Val atomically loads t.value.

type Uint64 Uses

type Uint64 struct {
    // contains filtered or unexported fields
}

func NewUint64 Uses

func NewUint64(value ...uint64) *Uint64

NewUint64 returns a concurrent-safe object for uint64 type, with given initial value <value>.

func (*Uint64) Add Uses

func (v *Uint64) Add(delta uint64) (new uint64)

Add atomically adds <delta> to t.value and returns the new value.

func (*Uint64) Cas Uses

func (v *Uint64) Cas(old, new uint64) bool

Cas executes the compare-and-swap operation for value.

func (*Uint64) Clone Uses

func (v *Uint64) Clone() *Uint64

Clone clones and returns a new concurrent-safe object for uint64 type.

func (*Uint64) Set Uses

func (v *Uint64) Set(value uint64) (old uint64)

Set atomically stores <value> into t.value and returns the previous value of t.value.

func (*Uint64) Val Uses

func (v *Uint64) Val() uint64

Val atomically loads t.value.

Package gtype imports 3 packages (graph) and is imported by 37 packages. Updated 2019-06-26. Refresh now. Tools for package owners.