util

package
v0.0.0-...-2ec1ec0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanExpiredProjectInfo

func CleanExpiredProjectInfo(expiredTimeSeconds int64)

func Contains

func Contains(list []string, s string) bool

Contains is used to check whether a list contains string s

func FetchUserProjectList

func FetchUserProjectList(token string, url string) []string

func GetAllManagedClusterNames

func GetAllManagedClusterNames() map[string]string

func GetUserName

func GetUserName(token string, url string) string

func GetUserProjectList

func GetUserProjectList(token string) ([]string, bool)

func InitAllManagedClusterNames

func InitAllManagedClusterNames()

func InitUserProjectInfo

func InitUserProjectInfo()

func ModifyMetricsQueryParams

func ModifyMetricsQueryParams(req *http.Request, url string)

ModifyMetricsQueryParams will modify request url params for query metrics

func UpdateUserProject

func UpdateUserProject(up UserProject)

func WatchManagedCluster

func WatchManagedCluster(clusterClient clusterclientset.Interface)

WatchManagedCluster will watch and save managedcluster when create/update/delete managedcluster

Types

type UserProject

type UserProject struct {
	UserName    string
	Timestamp   int64
	Token       string
	ProjectList []string
}

func NewUserProject

func NewUserProject(userName string, token string, projects []string) UserProject

type UserProjectInfo

type UserProjectInfo struct {
	sync.RWMutex
	ProjectInfo map[string]UserProject
}

Jump to

Keyboard shortcuts

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