collection

package
v0.0.0-...-da2e21c Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapInterface

type MapInterface map[interface{}]interface{}

MapInterface is the alias of map[interface{}]interface{} what have operation methods

func (MapInterface) Delete

func (receiver MapInterface) Delete(key interface{}) MapInterface

Delete removes the specified value related to given key from the map

func (MapInterface) Exists

func (receiver MapInterface) Exists(key interface{}) bool

Exists returns if the key is in the map or not

func (MapInterface) Get

func (receiver MapInterface) Get(key interface{}) interface{}

Get gets the value related to given key from the map

func (MapInterface) Keys

func (receiver MapInterface) Keys() (interface{}, error)

Keys returns its keys as an slice

func (MapInterface) Length

func (receiver MapInterface) Length() interface{}

Length returns its length

func (MapInterface) Merge

func (receiver MapInterface) Merge(source MapInterface) MapInterface

Merge merges the given map into this map

func (MapInterface) Put

func (receiver MapInterface) Put(key interface{}, value interface{}) MapInterface

Put puts given value into the map

func (MapInterface) Values

func (receiver MapInterface) Values() interface{}

Values returns its values as an slice

type Utility

type Utility struct {
}

Utility handles collection operation

func GetUtility

func GetUtility() *Utility

GetUtility returns the instance of utility

func (*Utility) Append

func (receiver *Utility) Append(sliceInterface interface{}, item ...interface{}) (interface{}, error)

Append returns a slice appended given items

func (*Utility) Concatenate

func (receiver *Utility) Concatenate(sliceInterface1 interface{}, sliceInterface2 interface{}) (interface{}, error)

Concatenate returns a slice concatenated two slices

func (*Utility) FieldSlice

func (receiver *Utility) FieldSlice(slice interface{}, fieldName string) (interface{}, error)

FieldSlice returns a slice of specified field value from given struct slice

func (*Utility) Hash

func (receiver *Utility) Hash(slice interface{}, keyField string) (MapInterface, error)

Hash makes a map from given struct slice with the specified field as the key

func (*Utility) Map

func (receiver *Utility) Map(pairs ...interface{}) (MapInterface, error)

Map makes a map from given pairs

func (*Utility) Sequence

func (receiver *Utility) Sequence(begin, end int) interface{}

Sequence makes a slice of sequential integer values

func (*Utility) Slice

func (receiver *Utility) Slice(items ...interface{}) interface{}

Slice returns a slice object which consists of given items

func (*Utility) Sort

func (receiver *Utility) Sort(slice interface{}, order string) (interface{}, error)

Sort sorts the given slice and returns sorted one

func (*Utility) SubSlice

func (receiver *Utility) SubSlice(sliceInterface interface{}, begin int, end int) (interface{}, error)

SubSlice returns a sub slice object of given slice

Jump to

Keyboard shortcuts

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