gvar

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Var

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

Var is an universal variable type implementer.

func Create

func Create(value interface{}, safe ...bool) Var

Create creates and returns a new Var with given `value`. The optional parameter `safe` specifies whether Var is used in concurrent-safety, which is false in default.

func New

func New(value interface{}, safe ...bool) *Var

New creates and returns a new Var with given `value`. The optional parameter `safe` specifies whether Var is used in concurrent-safety, which is false in default.

func (*Var) Bool

func (v *Var) Bool() bool

Bool converts and returns `v` as bool.

func (*Var) Bytes

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

Bytes converts and returns `v` as []byte.

func (*Var) Clone

func (v *Var) Clone() *Var

Clone does a shallow copy of current Var and returns a pointer to this Var.

func (*Var) Float32

func (v *Var) Float32() float32

Float32 converts and returns `v` as float32.

func (*Var) Float64

func (v *Var) Float64() float64

Float64 converts and returns `v` as float64.

func (*Var) Int

func (v *Var) Int() int

Int converts and returns `v` as int.

func (*Var) Int16

func (v *Var) Int16() int16

Int16 converts and returns `v` as int16.

func (*Var) Int32

func (v *Var) Int32() int32

Int32 converts and returns `v` as int32.

func (*Var) Int64

func (v *Var) Int64() int64

Int64 converts and returns `v` as int64.

func (*Var) Int8

func (v *Var) Int8() int8

Int8 converts and returns `v` as int8.

func (*Var) Interface

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

Interface is alias of Val.

func (*Var) MarshalJSON

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

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*Var) Set

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

Set sets `value` to `v`, and returns the old value.

func (*Var) String

func (v *Var) String() string

String converts and returns `v` as string.

func (*Var) Uint

func (v *Var) Uint() uint

Uint converts and returns `v` as uint.

func (*Var) Uint16

func (v *Var) Uint16() uint16

Uint16 converts and returns `v` as uint16.

func (*Var) Uint32

func (v *Var) Uint32() uint32

Uint32 converts and returns `v` as uint32.

func (*Var) Uint64

func (v *Var) Uint64() uint64

Uint64 converts and returns `v` as uint64.

func (*Var) Uint8

func (v *Var) Uint8() uint8

Uint8 converts and returns `v` as uint8.

func (*Var) UnmarshalJSON

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

UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.

func (*Var) UnmarshalValue

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

UnmarshalValue is an interface implement which sets any type of value for Var.

func (*Var) Val

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

Val returns the current value of `v`.

Jump to

Keyboard shortcuts

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