handlers

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamespaceErrorHandler

func NamespaceErrorHandler(ctx echo.Context, err error) error

parses different errors from kubernetes and returns a custom error message

func StringWithCharset

func StringWithCharset(length int, charset string) string

StringWithCharset generates a random string of the specified length using the characters from the given charset. It returns the generated random string.

Types

type Container

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

Container will hold all dependencies for your application.

func NewContainer

func NewContainer(clientset *kubernetes.Clientset, cfg *models.Config) (*Container, error)

NewContainer returns an empty or an initialized container for your handlers.

func (*Container) BasicAuthValidator

func (c *Container) BasicAuthValidator(username, password string, e echo.Context) (bool, error)

func (*Container) CreateNamespace

func (c *Container) CreateNamespace(ctx echo.Context) error

CreateNamespace - Create a new namespace TODO: reduce complexity

func (*Container) DeleteNamespace

func (c *Container) DeleteNamespace(ctx echo.Context) error

DeleteNamespace - Deletes a namespace

func (*Container) GetBuildInfo

func (c *Container) GetBuildInfo(e echo.Context) error

func (*Container) GetKubeconfig

func (c *Container) GetKubeconfig(namespace string, secret *v1.Secret, ctx echo.Context) (*clientcmdapi.Config, error)

get secret name with service account token for a given namespace and generate a kubeconfigiuration

func (*Container) GetNamespaceByName

func (c *Container) GetNamespaceByName(ctx echo.Context) error

GetNamespaceByName - Find namespace by name

func (*Container) GetNamespaces

func (c *Container) GetNamespaces(ctx echo.Context) error

GetNamespaces - Get all namespaces

func (*Container) LivenessProbe

func (c *Container) LivenessProbe(e echo.Context) error

func (*Container) ReadinessProbe

func (c *Container) ReadinessProbe(e echo.Context) error

func (*Container) SetBasicAuthUserList

func (c *Container) SetBasicAuthUserList(cfg *models.Config)

Jump to

Keyboard shortcuts

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