vmap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOutofIndex = errors.New("vmap.SliceV: out of index")
View Source
var ErrTooLarge = errors.New("vmap.SliceV: too large")

Functions

This section is empty.

Types

type IntMap

type IntMap map[int]string

type MapInt

type MapInt map[string]int

type MapStr

type MapStr map[string]string

type SliceV

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

func NewSliceV

func NewSliceV(n int) *SliceV

func (*SliceV) Cap

func (sv *SliceV) Cap() int

func (*SliceV) Get

func (sv *SliceV) Get(n int) (V, error)

func (*SliceV) Grow

func (sv *SliceV) Grow(n int)

func (*SliceV) Len

func (sv *SliceV) Len() int

func (*SliceV) Less

func (sv *SliceV) Less(i, j int) bool

func (*SliceV) MarshalJSON

func (sv *SliceV) MarshalJSON() ([]byte, error)

func (*SliceV) Slices

func (sv *SliceV) Slices() []V

func (*SliceV) Sort

func (sv *SliceV) Sort()

func (*SliceV) String

func (sv *SliceV) String() string

func (*SliceV) Swap

func (sv *SliceV) Swap(i, j int)

func (*SliceV) Write

func (sv *SliceV) Write(v ...V) (n int, err error)

type SortV

type SortV []V

func AppendSortV

func AppendSortV(sv SortV, v ...V) SortV

Append 向SortV类型追加元素

func NewSortV

func NewSortV(n int) SortV

NewSortV 初始化SortV

func (SortV) Len

func (sv SortV) Len() int

func (SortV) Less

func (sv SortV) Less(i, j int) bool

func (SortV) Sort

func (sv SortV) Sort()

func (SortV) Swap

func (sv SortV) Swap(i, j int)

type V

type V map[string]interface{}

V 自定义的map类型,用于规范处理json

func (V) Copy

func (v V) Copy(src V)

func (V) JSON

func (v V) JSON(name string) []byte

JSON 将map转换为json

func (V) Keys

func (v V) Keys() []string

Keys 获取map的key,并保存到数组

func (V) ObjType

func (v V) ObjType(k, vtype string) interface{}

ObjType 获取interface的类型

func (V) SignStr

func (v V) SignStr() string

func (V) ToString

func (v V) ToString(k string) string

func (V) Type

func (v V) Type(key string) string

Type 返回key所对应值的类型

func (V) Unmarshal

func (v V) Unmarshal(out interface{}) error

Unmarshal 将V转换为其他的结构体

func (V) VBool

func (v V) VBool(k string) bool

VBool 返回bool类型的值。没有key或值的类型不是bool,返回false

func (V) VFloat64

func (v V) VFloat64(k string) float64

func (V) VInt

func (v V) VInt(k string) int

VInt 获取int类型的值。如果value类型不是int或没有key,返回-1

func (V) VInt32

func (v V) VInt32(k string) int32

VInt 获取int类型的值。如果value类型不是int或没有key,返回-1

func (V) VInt64

func (v V) VInt64(k string) int64

VInt64 获取int64类型的值。如果value类型不是int64或没有key,返回0

func (V) VMap

func (v V) VMap(k string) V

VMap 返回vmap.V类型的值

func (V) VSortV

func (v V) VSortV(k string) SortV

func (V) VString

func (v V) VString(k string) string

VString 返回字符串

func (V) VStrings

func (v V) VStrings(k string) []string

VStrings 返回字符串数组

Jump to

Keyboard shortcuts

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