util

package
v0.0.0-...-f264b1e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanExpiredProjectInfo

func CleanExpiredProjectInfo(expiredTimeSeconds int64)

func CleanExpiredProjectInfoJob

func CleanExpiredProjectInfoJob(expiredTimeSeconds int64)

func FetchUserProjectList

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

func GetAllManagedClusterLabelNames

func GetAllManagedClusterLabelNames() map[string]bool

GetAllManagedClusterLabelNames returns all managed cluster labels.

func GetAllManagedClusterNames

func GetAllManagedClusterNames() map[string]string

GetAllManagedClusterNames returns all managed cluster names.

func GetManagedClusterEventHandler

func GetManagedClusterEventHandler() cache.ResourceEventHandlerFuncs

GetManagedClusterEventHandler return event handler functions for managed cluster watch events.

func GetManagedClusterLabelAllowListEventHandler

func GetManagedClusterLabelAllowListEventHandler(kubeClient kubernetes.Interface) cache.ResourceEventHandlerFuncs

GetManagedClusterLabelAllowListEventHandler return event handler for managedcluster label allow list watch event.

func GetUserName

func GetUserName(token string, url string) string

func GetUserProjectList

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

func InitAllManagedClusterLabelNames

func InitAllManagedClusterLabelNames()

InitAllManagedClusterLabelNames initializes all managed cluster labels map.

func InitAllManagedClusterNames

func InitAllManagedClusterNames()

InitAllManagedClusterNames initializes all managed cluster names map.

func InitScheduler

func InitScheduler()

func InitUserProjectInfo

func InitUserProjectInfo()

func ModifyMetricsQueryParams

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

ModifyMetricsQueryParams will modify request url params for query metrics.

func ScheduleManagedClusterLabelAllowlistResync

func ScheduleManagedClusterLabelAllowlistResync(kubeClient kubernetes.Interface)

func StopScheduleManagedClusterLabelAllowlistResync

func StopScheduleManagedClusterLabelAllowlistResync()

func UpdateUserProject

func UpdateUserProject(up UserProject)

func WatchManagedCluster

func WatchManagedCluster(clusterClient clusterclientset.Interface, kubeClient kubernetes.Interface)

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

func WatchManagedClusterLabelAllowList

func WatchManagedClusterLabelAllowList(kubeClient kubernetes.Interface)

WatchManagedClusterLabelAllowList will watch and save managedcluster label allowlist configmap when create/update/delete.

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