collection

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrScanStructEmptySrc = errors.New("ScanStruct:src must not be empty")
)
View Source
var (
	ScanTagName = "json"
)

Functions

func DiffSlice

func DiffSlice(a, b []string) []string

func InInt

func InInt(find int, arr []int) bool

func InStr

func InStr(find string, arr []string) bool

func ScanStruct

func ScanStruct(src map[string]string, dest interface{}) error

Types

type MapSorter

type MapSorter struct {
	Keys []string
	Vals []string
}

map sort

func NewMapSorter

func NewMapSorter(m map[string]string) *MapSorter

func (*MapSorter) Len

func (ms *MapSorter) Len() int

func (*MapSorter) Less

func (ms *MapSorter) Less(i, j int) bool

func (*MapSorter) Sort

func (ms *MapSorter) Sort()

func (*MapSorter) Swap

func (ms *MapSorter) Swap(i, j int)

type StrMap

type StrMap map[string]string

func (StrMap) Keys

func (this StrMap) Keys() []string

func (StrMap) ToInterface

func (this StrMap) ToInterface() map[string]interface{}

type StrMaps

type StrMaps []map[string]string

func (StrMaps) IndexBy

func (this StrMaps) IndexBy(indexKey string, keys ...string) map[string]map[string]string

[] map[string]string => map[string] map[string]string

func (StrMaps) Pluck

func (this StrMaps) Pluck(indexKey string, valueKey string) map[string]string

[] map[string]string => map[string]string

Jump to

Keyboard shortcuts

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