util

package
v0.0.0-...-4de6f6b Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Metadata          = "metadata"
	UID               = "uid"
	Name              = "name"
	ResourceID        = "resourceid"
	ObjType           = "objtype"
	Objects           = "objects"
	K8sObj            = "k8sobj"
	Cluster           = "cluster"
	Namespace         = "namespace"
	Many              = "many"
	Relationship      = "relationship"
	JSON              = "json"
	Pod               = "pod"
	Deployment        = "deployment"
	Ingress           = "ingress"
	ReplicaSet        = "replicaset"
	Service           = "service"
	StatefulSet       = "statefulset"
	Owner             = "owner"
	OwnerType         = "ownertype"
	ResourceVersion   = "resourceversion"
	Node              = "node"
	Application       = "application"
	ClusterName       = "clustername"
	Labels            = "labels"
	CreationTime      = "creationtime"
	NumReplicas       = "numreplicas"
	AvailableReplicas = "availablereplicas"
	Strategy          = "strategy"
	DefaultBackend    = "defaultbackend"
	TSL               = "tsl"
	Rules             = "rules"
	Phase             = "phase"
	NodeName          = "nodename"
	IP                = "ip"
	Containers        = "containers"
	Volumes           = "volumes"
	PodSpec           = "podspec"
	Ports             = "ports"
	ServiceType       = "servicetype"
	ClusterIP         = "clusterip"
	Selector          = "selector"
	App               = "app"
	K8sApp            = "k8s-app"
	Fields            = "fields"
	FieldName         = "fieldname"
	FieldType         = "fieldtype"
	Mandatory         = "mandatory"
	Cardinality       = "cardinality"
	One               = "one"
	Query             = "query"
	StartTime         = "starttime"
	Count             = "count"
	First             = "first"
	Limit             = "limit"
	Offset            = "offset"
	Print             = "print"
	Asset             = "asset"
	AssetID           = "iks.intuit.com/service-asset-id"
	RetryCount        = 20
)

REST API constants

Variables

This section is empty.

Functions

func NewBackOff

func NewBackOff() *backoff.ExponentialBackOff

NewBackOff creates an instance of ExponentialBackOff using default values.

func ReadCounter

func ReadCounter(m prometheus.Counter) float64

ReadCounter ...Extract float64 Value from the prometheus Counter metric

func RegisterHistogramMetrics

func RegisterHistogramMetrics()

RegisterHistogramMetrics ...Register histogram with prometheus

Types

type KeyMutex

type KeyMutex struct {
	// contains filtered or unexported fields
}

KeyMutex use for lock resource base on specified key use sync.Mutex that ensure map can be accessed safely by multi thread

func NewKeyMutex

func NewKeyMutex(maxDuration time.Duration, delayFactor int) *KeyMutex

NewKeyMutex returns KeyMutex instance

func (KeyMutex) TryLock

func (k KeyMutex) TryLock(key interface{}) bool

TryLock try lock by key

func (KeyMutex) Unlock

func (k KeyMutex) Unlock(key interface{})

Unlock remove key from map

type OptionContext

type OptionContext struct {
	// is replace field when update
	ReplaceListOrEdge bool
}

OptionContext to define options when CRUD entities

Jump to

Keyboard shortcuts

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