gtype

package
v1.5.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package gtype provides kinds of high performance, 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

func NewBool(value ...bool) *Bool

func (*Bool) Clone

func (t *Bool) Clone() *Bool

func (*Bool) Set

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

并发安全设置变量值,返回之前的旧值

func (*Bool) Val

func (t *Bool) Val() bool

type Byte

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

func NewByte

func NewByte(value ...byte) *Byte

func (*Byte) Add

func (t *Byte) Add(delta int) byte

func (*Byte) Clone

func (t *Byte) Clone() *Byte

func (*Byte) Set

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

并发安全设置变量值,返回之前的旧值

func (*Byte) Val

func (t *Byte) Val() byte

type Bytes

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

func NewBytes

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

func (*Bytes) Clone

func (t *Bytes) Clone() *Bytes

func (*Bytes) Set

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

func (*Bytes) Val

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

type Float32

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

func NewFloat32

func NewFloat32(value ...float32) *Float32

func (*Float32) Add

func (t *Float32) Add(delta float32) float32

func (*Float32) Clone

func (t *Float32) Clone() *Float32

func (*Float32) Set

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

func (*Float32) Val

func (t *Float32) Val() float32

type Float64

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

func NewFloat64

func NewFloat64(value ...float64) *Float64

func (*Float64) Add

func (t *Float64) Add(delta float64) float64

func (*Float64) Clone

func (t *Float64) Clone() *Float64

func (*Float64) Set

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

func (*Float64) Val

func (t *Float64) Val() float64

type Int

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

func NewInt

func NewInt(value ...int) *Int

func (*Int) Add

func (t *Int) Add(delta int) int

数值增加delta,并返回**新**的数值

func (*Int) Clone

func (t *Int) Clone() *Int

func (*Int) Set

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

并发安全设置变量值,返回之前的旧值

func (*Int) Val

func (t *Int) Val() int

type Int32

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

func NewInt32

func NewInt32(value ...int32) *Int32

func (*Int32) Add

func (t *Int32) Add(delta int32) int32

func (*Int32) Clone

func (t *Int32) Clone() *Int32

func (*Int32) Set

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

func (*Int32) Val

func (t *Int32) Val() int32

type Int64

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

func NewInt64

func NewInt64(value ...int64) *Int64

func (*Int64) Add

func (t *Int64) Add(delta int64) int64

func (*Int64) Clone

func (t *Int64) Clone() *Int64

func (*Int64) Set

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

func (*Int64) Val

func (t *Int64) Val() int64

type Interface

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

比较通用的并发安全数据类型

func NewInterface

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

func (*Interface) Clone

func (t *Interface) Clone() *Interface

func (*Interface) Set

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

func (*Interface) Val

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

type String

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

func NewString

func NewString(value ...string) *String

func (*String) Clone

func (t *String) Clone() *String

func (*String) Set

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

func (*String) Val

func (t *String) Val() string

type Type

type Type = Interface

func New

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

type Uint

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

func NewUint

func NewUint(value ...uint) *Uint

func (*Uint) Add

func (t *Uint) Add(delta uint) int

func (*Uint) Clone

func (t *Uint) Clone() *Uint

func (*Uint) Set

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

func (*Uint) Val

func (t *Uint) Val() uint

type Uint32

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

func NewUint32

func NewUint32(value ...uint32) *Uint32

func (*Uint32) Add

func (t *Uint32) Add(delta uint32) uint32

func (*Uint32) Clone

func (t *Uint32) Clone() *Uint32

func (*Uint32) Set

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

func (*Uint32) Val

func (t *Uint32) Val() uint32

type Uint64

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

func NewUint64

func NewUint64(value ...uint64) *Uint64

func (*Uint64) Add

func (t *Uint64) Add(delta uint64) uint64

func (*Uint64) Clone

func (t *Uint64) Clone() *Uint64

func (*Uint64) Set

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

func (*Uint64) Val

func (t *Uint64) Val() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL