utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFormatter

func CreateFormatter(logFormat string) log.Formatter

func DoTransaction

func DoTransaction(logCtx *log.Entry, taskList ...Task) error

func GetConfigMapData

func GetConfigMapData(configMap *v1.ConfigMap, configMapKey string, destination any) error

func GetKubeConfig

func GetKubeConfig() (*rest.Config, error)

func GetOrCreateConfigMap added in v0.1.1

func GetOrCreateConfigMap(name string, options CreateConfigMapOptions) (*v1.ConfigMap, error)

func RemoveIndex

func RemoveIndex[T any](original []T, index int) []T

func SetLogLevel

func SetLogLevel(logLevel string)

func UpdateConfigMapData

func UpdateConfigMapData(configMap *v1.ConfigMap, configMapData any, options UpdateConfigMapOptions) error

Types

type CreateConfigMapOptions

type CreateConfigMapOptions struct {
	Clientset v1.ConfigMapInterface
	Ctx       context.Context
}

type Task

type Task struct {
	Action        func() error
	ReverseAction func() error
}

type UpdateConfigMapOptions

type UpdateConfigMapOptions struct {
	Clientset    v1.ConfigMapInterface
	ConfigMapKey string
	Ctx          context.Context
}

Jump to

Keyboard shortcuts

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