helpers

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCluster

func GetCluster(url, clusterName, jwtToken string) (*cr.ClusterSpec, error)

GetCluster gets cluster from CR

func GetEnv

func GetEnv(key, fallback string, logger echo.Logger) string

GetEnv gets env variable with an fallback value, if fallback is empty then env variable is mandatory and if missing exit the program

func GetFunctionName

func GetFunctionName(i interface{}) string

GetFunctionName returns the name ofa function

func GetRandomTime

func GetRandomTime(maxTime string, logger echo.Logger) string

GetRandomTime returns a random time interval as a string

func RunFuncInLoop

func RunFuncInLoop(f func(interface{}), config interface{}, timeInterval string, offSetStart string, logger echo.Logger)

RunFuncInLoop runs a function in a loop. f is the function to run, timeInterval is the time it waits to run again, offSetStart is the time to wait before the loop starts.

Types

type ClusterList

type ClusterList struct {
	Items      []*cr.ClusterSpec `json:"items"`
	ItemsCount int               `json:"itemsCount"`
}

ClusterList ...

func GetClusters

func GetClusters(url, perPageLimit, pageNr, jwtToken string) (*ClusterList, error)

GetClusters gets cluster from CR

Jump to

Keyboard shortcuts

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