any

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

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

Any the replacement for interface{}

func Make

func Make() *Any

Make create a empty instance

func Of

func Of(value interface{}) *Any

Of create a new instance

func (Any) Array added in v0.8.0

func (v Any) Array() []interface{}

Array returns <v> as []interface{}

func (Any) Bool

func (v Any) Bool() bool

Bool returns <v> as bool

func (Any) CArray added in v0.8.0

func (v Any) CArray() []interface{}

CArray returns <v> as []interface{}

func (Any) CBool

func (v Any) CBool() bool

CBool converts and returns <v> as bool

func (Any) CFloat

func (v Any) CFloat() float64

CFloat is alias of CFloat64 converts and returns <v> as float64

func (Any) CFloat64

func (v Any) CFloat64() float64

CFloat64 converts and returns <v> as float64

func (Any) CFloat64s

func (v Any) CFloat64s() []float64

CFloat64s converts and returns <v> as []float64

func (Any) CFloats

func (v Any) CFloats() []float64

CFloats is alias of CFloat64s converts and returns <v> as []float64

func (Any) CInt

func (v Any) CInt() int

CInt converts and returns <v> as int

func (Any) CInts

func (v Any) CInts() []int

CInts converts and returns <v> as []int

func (Any) CString

func (v Any) CString() string

CString converts and returns <v> as string.

func (Any) CStrings

func (v Any) CStrings() []string

CStrings converts and returns <v> as []string.

func (Any) Datetime

func (v Any) Datetime() *day.Datetime

Datetime converts and returns <v> as day.Datetime

func (Any) Float

func (v Any) Float() float64

Float is alias of Float64 returns <v> as float64

func (Any) Float64

func (v Any) Float64() float64

Float64 returns <v> as float64

func (Any) Float64s

func (v Any) Float64s() []float64

Float64s returns <v> as []float64

func (Any) Floats

func (v Any) Floats() []float64

Floats is alias of Float64s returns <v> as []float64

func (Any) Get

func (v Any) Get() interface{}

Get returns the current value of <v>.

func (Any) Int

func (v Any) Int() int

Int returns <v> as int

func (Any) Interface

func (v Any) Interface() interface{}

Interface is alias of Get.

func (Any) Interfaces

func (v Any) Interfaces() []interface{}

Interfaces converts and returns <v> as []interfaces{}.

func (Any) Ints

func (v Any) Ints() []int

Ints returns <v> as []int

func (Any) IsArray

func (v Any) IsArray() bool

IsArray checks whether <v> is type of array.

func (Any) IsBool

func (v Any) IsBool() bool

IsBool checks whether <v> is type of bool.

func (Any) IsCollection

func (v Any) IsCollection() bool

IsCollection checks whether <v> is type of array or slice.

func (Any) IsDatetime

func (v Any) IsDatetime() bool

IsDatetime checks whether <v> is type of datetime.

func (Any) IsEmpty

func (v Any) IsEmpty() bool

IsEmpty checks whether <v> is empty.

func (Any) IsFloat

func (v Any) IsFloat() bool

IsFloat checks whether <v> is type of float.

func (Any) IsInt

func (v Any) IsInt() bool

IsInt checks whether <v> is type of int.

func (Any) IsMap

func (v Any) IsMap() bool

IsMap checks whether <v> is type of map.

func (Any) IsNil

func (v Any) IsNil() bool

IsNil checks whether <v> is nil.

func (Any) IsNotNil

func (v Any) IsNotNil() bool

IsNotNil checks whether <v> is not nil.

func (Any) IsNumber

func (v Any) IsNumber() bool

IsNumber checks whether <v> is type of number.

func (Any) IsSlice

func (v Any) IsSlice() bool

IsSlice checks whether <v> is type of slice.

func (Any) IsString added in v0.6.2

func (v Any) IsString() bool

IsString checks whether <v> is type of string.

func (Any) Map

func (v Any) Map() Map

Map converts and returns <v> as maps.Map

func (Any) MapStr added in v0.6.7

func (v Any) MapStr() maps.MapStrAny

MapStr converts and returns <v> as maps.MapStr

func (*Any) MarshalJSON

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

MarshalJSON for json marshalJSON

func (Any) Number

func (v Any) Number() *num.Number

Number converts and returns <v> as num.Number

func (*Any) Scan

func (v *Any) Scan(src interface{}) error

Scan for db scan

func (*Any) Set

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

Set set <value> to <v>, and returns the old value.

func (Any) String

func (v Any) String() string

String returns <v> as string.

func (Any) Strings

func (v Any) Strings() []string

Strings returns <v> as []string.

func (*Any) UnmarshalJSON

func (v *Any) UnmarshalJSON(data []byte) error

UnmarshalJSON for json marshalJSON

func (Any) Val

func (v Any) Val() interface{}

Val is alias of Get.

func (*Any) Value

func (v *Any) Value() (driver.Value, error)

Value for db driver value

type Map

type Map struct {
	maps.MapStrAny
}

Map the replacement for Maps.Map

func MakeMap

func MakeMap() Map

MakeMap create a new map instance

func MapOf

func MapOf(values interface{}) Map

MapOf create a new map instance

func (Map) Any

func (m Map) Any(key string) *Any

Any returns the value stored in the map for a key.

func (Map) Dot

func (m Map) Dot() Map

Dot The Dot method flattens a multi-dimensional map[string]inteface{} into a single level map[string]inteface{} that uses "dot" notation to indicate depth

func (Map) Flatten

func (m Map) Flatten() Map

Flatten The Flatten method is alias of Dot, to flatten a multi-dimensional map[string]inteface{} into a single level map[string]inteface{} that uses "dot" notation to indicate depth

type Sync

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

Sync the replacement for concurrent safe interface

func MakeSync

func MakeSync() *Sync

MakeSync create a empty instance

func SyncOf

func SyncOf(value interface{}) *Sync

SyncOf create a new instance

func (*Sync) CString

func (v *Sync) CString() string

CString converts and returns <v> as string.

func (*Sync) Get

func (v *Sync) Get() interface{}

Get returns the current value of <v>.

func (*Sync) Interface

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

Interface is alias of Get.

func (*Sync) Set

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

Set set <value> to <v>, and returns the old value.

func (*Sync) String

func (v *Sync) String() string

String returns <v> as string.

func (*Sync) Val

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

Val is alias of Get.

Jump to

Keyboard shortcuts

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