common

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default = "Default"
)

Variables

View Source
var (

	// cmp bashboard table
	CMPDashboardChangePageNoOperationKey   cptype.OperationKey = "changePageNo"
	CMPDashboardChangePageSizeOperationKey cptype.OperationKey = "changePageSize"
	CMPDashboardSortByColumnOperationKey   cptype.OperationKey = "changeSort"

	// cmp bashboard clusterFilter
	CMPDashboardFilterOperationKey cptype.OperationKey = "filter"

	// Freeze Button
	CMPDashboardUncordonNode cptype.OperationKey = "uncordon"
	CMPDashboardCordonNode   cptype.OperationKey = "cordon"
	CMPDashboardDrainNode    cptype.OperationKey = "drain"
	CMPDashboardOfflineNode  cptype.OperationKey = "offline"
	CMPDashboardOnlineNode   cptype.OperationKey = "online"
	CMPDashboardBatchSubmit  cptype.OperationKey = "batchSubmit"

	CMPDashboardTableTabs cptype.OperationKey = "changeViewType"

	CMPDashboardSubmit cptype.OperationKey = "submit"

	CMPDashboardRemoveLabel cptype.OperationKey = "deleteLabel"
)
View Source
var (
	NodeNotFoundErr    = errors.New("node not found")
	ClusterNotFoundErr = errors.New("cluster not found")
	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 GetPercent

func GetPercent(a, b float64) string

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