helper

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneSlice

func CloneSlice(src []interface{}) ([]interface{}, error)

CloneSlice source to destination

func CompareBool

func CompareBool(value interface{}, operator string, expectedValue interface{}) bool

CompareBool compares strings

func CompareFloat

func CompareFloat(value interface{}, operator string, expectedValue interface{}) bool

CompareFloat compares float

func CompareString

func CompareString(value interface{}, operator string, filterValue interface{}) bool

CompareString compares strings

func Filter

func Filter(entities []interface{}, filters []storageTY.Filter, returnSingle bool) []interface{}

Filter filters the given slice

func FilterByStringMap

func FilterByStringMap(entities []interface{}, filtersMap map[string]string) []interface{}

FilterByStringMap filter

func GetID

func GetID(data interface{}) string

GetID returns ID from the interface

func GetSortByKeyPath

func GetSortByKeyPath(keyPath, orderBy string, data []interface{}) []interface{}

GetSortByKeyPath returns the slice in order

func GetValueByKeyPath

func GetValueByKeyPath(data interface{}, keyPath string) (reflect.Kind, interface{}, error)

GetValueByKeyPath returns type and value from the given struct returns reflect.Kind, value, error

func IsMatching

func IsMatching(entity interface{}, filters []storageTY.Filter) bool

IsMatching returns matching status

func IsMine

func IsMine(svcFilter *sfTY.ServiceFilter, targetType, targetID string, targetLabels cmap.CustomStringMap) bool

IsMine verifies the supplied id and labels with valid list

func Sort

func Sort(entities []interface{}, pagination *storageTY.Pagination) ([]interface{}, int64)

Sort given slice

func VerifyBoolSlice

func VerifyBoolSlice(value bool, operator string, filterValue interface{}) bool

VerifyBoolSlice implementation

func VerifyFloatSlice

func VerifyFloatSlice(value float64, operator string, expectedValue interface{}) bool

VerifyFloatSlice implementation

func VerifyStringSlice

func VerifyStringSlice(value string, operator string, filterValue interface{}) bool

VerifyStringSlice implementation

Types

This section is empty.

Jump to

Keyboard shortcuts

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