collections

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.1.10

func Contains(obj interface{}, target interface{}) bool

Contains @Description: slice | Array | Map .contains interface{} @param obj element @param target collection such as slice | Array | Map @return bool

func ContainsInt

func ContainsInt(value int, list []int) bool

ContainsInt @Description: @param value @param list @return bool

func ContainsString

func ContainsString(value string, list []string) bool

ContainsString @Description: @param value string @param list slice of string @return bool

func DeleteElementInSlice added in v0.1.10

func DeleteElementInSlice(a []interface{}, x interface{}) bool

func DeleteElementInSliceByIndex added in v0.1.10

func DeleteElementInSliceByIndex(a []interface{}, i int)

func FindElementInSlice added in v0.1.10

func FindElementInSlice(a []interface{}, x interface{}) int

func MapToSlice

func MapToSlice(input map[string]interface{}) []interface{}

MapToSlice @Description: convert map value to array @param input @return []interface{}

func StartsWith

func StartsWith(value string, list []string) (bool, string)

StartsWith @Description: @param value @param list @return bool startsWith @return string matched string

func StringMapToSlice added in v0.1.24

func StringMapToSlice(input map[string]string) []string

StringMapToSlice @Description: convert map value to string array @param input @return []interface{}

Types

type LinkedMap added in v0.1.10

type LinkedMap struct {
	LinkedKeyArray []interface{}
	Map            map[interface{}]interface{}
}

func (*LinkedMap) Clear added in v0.1.10

func (m *LinkedMap) Clear()

Clear @Description: clear collection with both keys and map @receiver m

func (*LinkedMap) ContainsKey added in v0.1.10

func (m *LinkedMap) ContainsKey(key interface{}) bool

func (*LinkedMap) Delete added in v0.1.10

func (m *LinkedMap) Delete(key interface{})

Delete @Description: delete element with both keys and map @receiver m @param key

func (*LinkedMap) Get added in v0.1.10

func (m *LinkedMap) Get(key interface{}) interface{}

func (*LinkedMap) GetString added in v0.1.10

func (m *LinkedMap) GetString(key interface{}) string

GetString @Description: return value in string @receiver m @param key @return string

func (*LinkedMap) Items added in v0.1.10

func (m *LinkedMap) Items() []MapItem

func (*LinkedMap) Put added in v0.1.10

func (m *LinkedMap) Put(key interface{}, value interface{})

func (*LinkedMap) StringItems added in v0.1.10

func (m *LinkedMap) StringItems() []MapItem

type MapItem added in v0.1.12

type MapItem struct {
	Key   interface{}
	Value interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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