common

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CMPDashboardAddLabel    cptype.OperationKey = "addLabel"
	CMPDashboardRemoveLabel cptype.OperationKey = "deleteLabel"

	NothingToBeDoneErr = errors.New("nothing to be done")

	TypeNotAvailableErr = errors.New("type not available")
	ResourceNotFoundErr = errors.New("resource type not available")

	//util error
	PtrRequiredErr = errors.New("ptr is required")
)

Functions

func ConvertToMap

func ConvertToMap(obj interface{}) (map[string]interface{}, error)

ConvertToMap transfer any struct to map

func GetInt64Len

func GetInt64Len(a int64) int

func GetPercent

func GetPercent(a, b float64) int

func GetStatus

func GetStatus(s string) string

func ResetNumberBase

func ResetNumberBase(a, b float64) (float64, float64)
ResetNumberBase

* e.g. : 20 100 to 2 10 , 0.1 1000 to 1 10000

func SortByDistribution

func SortByDistribution(data []interface{}, sortColumn string, asc bool)

SortByDistribution sort by percent

func SortByNode

func SortByNode(data []interface{}, sortColumn string, asc bool)

SortByNode sort by node struct

func SortByString

func SortByString(data []interface{}, sortColumn string, asc bool)

SortByString sort by string value

func Transfer

func Transfer(a, b interface{}) error

Transfer transfer a to b with json, kind of b must be pointer

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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