dtype

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

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 并发安全的 bool 对象

func NewBool

func NewBool(value ...bool) *Bool

NewBool 创建一个并发安全的bool对象,并且默认值是可选

func (*Bool) Cas

func (that *Bool) Cas(old, new bool) (swapped bool)

Cas 并发安全的值比较与值交换

func (*Bool) Clone

func (that *Bool) Clone() *Bool

Clone 并发安全的克隆它

func (*Bool) MarshalJson

func (that *Bool) MarshalJson() ([]byte, error)

MarshalJson json序列化

func (*Bool) Set

func (that *Bool) Set(val bool) (old bool)

Set 并发安全的设置值

func (*Bool) String

func (that *Bool) String() string

转换成字符串

func (*Bool) UnmarshalJson

func (that *Bool) UnmarshalJson(b []byte) error

UnmarshalJson json反序列化

func (*Bool) UnmarshalValue

func (that *Bool) UnmarshalValue(value interface{}) error

UnmarshalValue json反序列化的时候针对值的判断

func (*Bool) Val

func (that *Bool) Val() bool

Val 并发安全的获取bool对象的值

type Byte added in v0.0.7

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

Byte 并发安全的byte类型

func NewByte added in v0.0.7

func NewByte(value ...byte) *Byte

NewByte 新建一个byte对象

func (*Byte) Add added in v0.0.7

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

Add 添加delta

func (*Byte) Cas added in v0.0.7

func (that *Byte) Cas(old, new byte) (swapped bool)

Cas 原子性的替换新旧两个值

func (*Byte) Clone added in v0.0.7

func (that *Byte) Clone() *Byte

Clone 克隆被返回一个新的并发安全byte对象

func (*Byte) MarshalJSON added in v0.0.7

func (that *Byte) MarshalJSON() ([]byte, error)

func (*Byte) Set added in v0.0.7

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

Set 设置值

func (*Byte) String added in v0.0.7

func (that *Byte) String() string

转成字符串

func (*Byte) UnmarshalJSON added in v0.0.7

func (that *Byte) UnmarshalJSON(b []byte) error

func (*Byte) UnmarshalValue added in v0.0.7

func (that *Byte) UnmarshalValue(value interface{}) error

func (*Byte) Val added in v0.0.7

func (that *Byte) Val() byte

Val 获取值

type Bytes added in v0.0.7

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

Bytes 并发安全的bytes数组,[]byte

func NewBytes added in v0.0.7

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

NewBytes 新建一个并发安全的bytes对象,类似于 []byte 结构

func (*Bytes) Clone added in v0.0.7

func (that *Bytes) Clone() *Bytes

Clone 克隆并返回一个新的bytes对象

func (*Bytes) MarshalJSON added in v0.0.7

func (that *Bytes) MarshalJSON() ([]byte, error)

func (*Bytes) Set added in v0.0.7

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

Set 设置内容

func (*Bytes) String added in v0.0.7

func (that *Bytes) String() string

转换成字符串

func (*Bytes) UnmarshalJSON added in v0.0.7

func (that *Bytes) UnmarshalJSON(b []byte) error

func (*Bytes) UnmarshalValue added in v0.0.7

func (that *Bytes) UnmarshalValue(value interface{}) error

func (*Bytes) Val added in v0.0.7

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

Val 获取值

type Float32 added in v0.0.7

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

Float32 is a struct for concurrent-safe operation for type float32.

func NewFloat32 added in v0.0.7

func NewFloat32(value ...float32) *Float32

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

func (*Float32) Add added in v0.0.7

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

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

func (*Float32) Cas added in v0.0.7

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

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

func (*Float32) Clone added in v0.0.7

func (v *Float32) Clone() *Float32

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

func (*Float32) MarshalJSON added in v0.0.7

func (v *Float32) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*Float32) Set added in v0.0.7

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) String added in v0.0.7

func (v *Float32) String() string

String implements String interface for string printing.

func (*Float32) UnmarshalJSON added in v0.0.7

func (v *Float32) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.

func (*Float32) UnmarshalValue added in v0.0.7

func (v *Float32) UnmarshalValue(value interface{}) error

UnmarshalValue is an interface implement which sets any type of value for <v>.

func (*Float32) Val added in v0.0.7

func (v *Float32) Val() float32

Val atomically loads and returns t.value.

type Float64 added in v0.0.7

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

Float64 is a struct for concurrent-safe operation for type float64.

func NewFloat64 added in v0.0.7

func NewFloat64(value ...float64) *Float64

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

func (*Float64) Add added in v0.0.7

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

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

func (*Float64) Cas added in v0.0.7

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

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

func (*Float64) Clone added in v0.0.7

func (v *Float64) Clone() *Float64

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

func (*Float64) MarshalJSON added in v0.0.7

func (v *Float64) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*Float64) Set added in v0.0.7

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) String added in v0.0.7

func (v *Float64) String() string

String implements String interface for string printing.

func (*Float64) UnmarshalJSON added in v0.0.7

func (v *Float64) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.

func (*Float64) UnmarshalValue added in v0.0.7

func (v *Float64) UnmarshalValue(value interface{}) error

UnmarshalValue is an interface implement which sets any type of value for <v>.

func (*Float64) Val added in v0.0.7

func (v *Float64) Val() float64

Val atomically loads and returns t.value.

type Int

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

Int 并发安全的int对象

func NewInt

func NewInt(val ...int) *Int

NewInt 创建Int对象

func (*Int) Add

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

Add 并发安全设置int的值

func (*Int) Cas

func (that *Int) Cas(old, new int) (swapped bool)

Cas 安全的值比较与值交换

func (*Int) Clone

func (that *Int) Clone() *Int

Clone 并发安全克隆一个int对象

func (*Int) MarshalJSON

func (that *Int) MarshalJSON() ([]byte, error)

MarshalJSON json序列化

func (*Int) Reduce

func (that *Int) Reduce(delta int) (new int)

Reduce 减少 delta

func (*Int) Set

func (that *Int) Set(val int) (old int)

Set 并发安全设置int的值

func (*Int) String

func (that *Int) String() string

转换成字符串

func (*Int) UnmarshalJSON

func (that *Int) UnmarshalJSON(b []byte) error

UnmarshalJSON json反序列化

func (*Int) UnmarshalValue

func (that *Int) UnmarshalValue(value interface{}) error

UnmarshalValue 值的反序列化

func (*Int) Val

func (that *Int) Val() int

Val 并发安全获取int的值

type Int32 added in v0.0.3

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

Int32 并发安全的int对象

func NewInt32 added in v0.0.3

func NewInt32(val ...int) *Int32

NewInt32 创建Int32对象

func (*Int32) Add added in v0.0.3

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

Add 并发安全设置int的值

func (*Int32) Cas added in v0.0.3

func (that *Int32) Cas(old, new int32) (swapped bool)

Cas 安全的值比较与值交换

func (*Int32) Clone added in v0.0.3

func (that *Int32) Clone() *Int32

Clone 并发安全克隆一个int对象

func (*Int32) MarshalJSON added in v0.0.3

func (that *Int32) MarshalJSON() ([]byte, error)

MarshalJSON json序列化

func (*Int32) Reduce added in v0.0.3

func (that *Int32) Reduce(delta int32) (new int32)

Reduce 减少 delta

func (*Int32) Set added in v0.0.3

func (that *Int32) Set(val int32) (old int32)

Set 并发安全设置int的值

func (*Int32) String added in v0.0.3

func (that *Int32) String() string

转换成字符串

func (*Int32) UnmarshalJSON added in v0.0.3

func (that *Int32) UnmarshalJSON(b []byte) error

UnmarshalJSON json反序列化

func (*Int32) UnmarshalValue added in v0.0.3

func (that *Int32) UnmarshalValue(value interface{}) error

UnmarshalValue 值的反序列化

func (*Int32) Val added in v0.0.3

func (that *Int32) Val() int

Val 并发安全获取int的值

type Int64 added in v0.0.3

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

Int64 并发安全的int对象

func NewInt64 added in v0.0.3

func NewInt64(val ...int64) *Int64

NewInt64 创建Int对象

func (*Int64) Add added in v0.0.3

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

Add 并发安全设置int的值

func (*Int64) Cas added in v0.0.3

func (that *Int64) Cas(old, new int64) (swapped bool)

Cas 安全的值比较与值交换

func (*Int64) Clone added in v0.0.3

func (that *Int64) Clone() *Int64

Clone 并发安全克隆一个int对象

func (*Int64) MarshalJSON added in v0.0.3

func (that *Int64) MarshalJSON() ([]byte, error)

MarshalJSON json序列化

func (*Int64) Reduce added in v0.0.3

func (that *Int64) Reduce(delta int64) (new int64)

Reduce 减少 delta

func (*Int64) Set added in v0.0.3

func (that *Int64) Set(val int64) (old int64)

Set 并发安全设置int的值

func (*Int64) String added in v0.0.3

func (that *Int64) String() string

转换成字符串

func (*Int64) UnmarshalJSON added in v0.0.3

func (that *Int64) UnmarshalJSON(b []byte) error

UnmarshalJSON json反序列化

func (*Int64) UnmarshalValue added in v0.0.3

func (that *Int64) UnmarshalValue(value interface{}) error

UnmarshalValue 值的反序列化

func (*Int64) Val added in v0.0.3

func (that *Int64) Val() int64

Val 并发安全获取int的值

type Interface

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

func NewInterface

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

NewInterface 创建interface类型

func (*Interface) Clone

func (that *Interface) Clone() *Interface

func (*Interface) MarshalJSON

func (that *Interface) MarshalJSON() ([]byte, error)

MarshalJSON 序列化json

func (*Interface) Set

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

Set 设置值

func (*Interface) String

func (that *Interface) String() string

转换成string

func (*Interface) UnmarshalJSON

func (that *Interface) UnmarshalJSON(b []byte) error

UnmarshalJSON 反序列化json

func (*Interface) UnmarshalValue

func (that *Interface) UnmarshalValue(value interface{}) error

UnmarshalValue 反序列化值

func (*Interface) Val

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

Val 获取值

type String

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

func NewString

func NewString(value ...string) *String

NewString 创建并发安全的string对象

func (*String) Clone

func (that *String) Clone() *String

func (*String) MarshalJSON

func (that *String) MarshalJSON() ([]byte, error)

func (*String) Set

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

func (*String) String

func (that *String) String() string

func (*String) UnmarshalJSON

func (that *String) UnmarshalJSON(b []byte) error

func (*String) UnmarshalValue

func (that *String) UnmarshalValue(value interface{}) error

func (*String) Val

func (that *String) Val() string

type Type added in v0.0.7

type Type = Interface

Type is alias of Interface.

func New added in v0.0.7

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

New is alias of NewInterface. See NewInterface.

type Uint added in v0.0.7

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

Uint is a struct for concurrent-safe operation for type uint.

func NewUint added in v0.0.7

func NewUint(value ...uint) *Uint

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

func (*Uint) Add added in v0.0.7

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

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

func (*Uint) Cas added in v0.0.7

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

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

func (*Uint) Clone added in v0.0.7

func (v *Uint) Clone() *Uint

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

func (*Uint) MarshalJSON added in v0.0.7

func (v *Uint) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*Uint) Set added in v0.0.7

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) String added in v0.0.7

func (v *Uint) String() string

String implements String interface for string printing.

func (*Uint) UnmarshalJSON added in v0.0.7

func (v *Uint) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.

func (*Uint) UnmarshalValue added in v0.0.7

func (v *Uint) UnmarshalValue(value interface{}) error

UnmarshalValue is an interface implement which sets any type of value for <v>.

func (*Uint) Val added in v0.0.7

func (v *Uint) Val() uint

Val atomically loads and returns t.value.

type Uint32 added in v0.0.7

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

Uint32 is a struct for concurrent-safe operation for type uint32.

func NewUint32 added in v0.0.7

func NewUint32(value ...uint32) *Uint32

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

func (*Uint32) Add added in v0.0.7

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

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

func (*Uint32) Cas added in v0.0.7

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

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

func (*Uint32) Clone added in v0.0.7

func (v *Uint32) Clone() *Uint32

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

func (*Uint32) MarshalJSON added in v0.0.7

func (v *Uint32) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*Uint32) Set added in v0.0.7

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) String added in v0.0.7

func (v *Uint32) String() string

String implements String interface for string printing.

func (*Uint32) UnmarshalJSON added in v0.0.7

func (v *Uint32) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.

func (*Uint32) UnmarshalValue added in v0.0.7

func (v *Uint32) UnmarshalValue(value interface{}) error

UnmarshalValue is an interface implement which sets any type of value for <v>.

func (*Uint32) Val added in v0.0.7

func (v *Uint32) Val() uint32

Val atomically loads and returns t.value.

type Uint64 added in v0.0.7

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

Uint64 is a struct for concurrent-safe operation for type uint64.

func NewUint64 added in v0.0.7

func NewUint64(value ...uint64) *Uint64

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

func (*Uint64) Add added in v0.0.7

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

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

func (*Uint64) Cas added in v0.0.7

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

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

func (*Uint64) Clone added in v0.0.7

func (v *Uint64) Clone() *Uint64

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

func (*Uint64) MarshalJSON added in v0.0.7

func (v *Uint64) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*Uint64) Set added in v0.0.7

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) String added in v0.0.7

func (v *Uint64) String() string

String implements String interface for string printing.

func (*Uint64) UnmarshalJSON added in v0.0.7

func (v *Uint64) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.

func (*Uint64) UnmarshalValue added in v0.0.7

func (v *Uint64) UnmarshalValue(value interface{}) error

UnmarshalValue is an interface implement which sets any type of value for <v>.

func (*Uint64) Val added in v0.0.7

func (v *Uint64) Val() uint64

Val atomically loads and returns t.value.

Jump to

Keyboard shortcuts

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