parser

package
v0.0.0-...-a36a61a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAnnotationsPrefix = "k8s.ngrok.com"

DefaultAnnotationsPrefix defines the common prefix used in the nginx ingress controller

Variables

View Source
var (
	// AnnotationsPrefix is the mutable attribute that the controller explicitly refers to
	AnnotationsPrefix = DefaultAnnotationsPrefix
)

Functions

func AnnotationsReferencesConfigmap

func AnnotationsReferencesConfigmap(obj client.Object) bool

AnnotationsReferencesConfigmap checks if at least one annotation in the Ingress rule references a configmap.

func GetAnnotationWithPrefix

func GetAnnotationWithPrefix(suffix string) string

GetAnnotationWithPrefix returns the annotation prefixed with the AnnotationsPrefix

func GetBoolAnnotation

func GetBoolAnnotation(name string, obj client.Object) (bool, error)

GetBoolAnnotation extracts a boolean from a client.Object annotation

func GetFloatAnnotation

func GetFloatAnnotation(name string, obj client.Object) (float32, error)

GetFloatAnnotation extracts a float32 from a client.Object annotation

func GetIntAnnotation

func GetIntAnnotation(name string, obj client.Object) (int, error)

GetIntAnnotation extracts an int from a client.Object annotation

func GetStringAnnotation

func GetStringAnnotation(name string, obj client.Object) (string, error)

GetStringAnnotation extracts a string from an client.Object annotation

func GetStringMapAnnotation

func GetStringMapAnnotation(name string, obj client.Object) (map[string]string, error)

func GetStringSliceAnnotation

func GetStringSliceAnnotation(name string, obj client.Object) ([]string, error)

func StringToURL

func StringToURL(input string) (*url.URL, error)

StringToURL parses the provided string into URL and returns error message in case of failure

Types

type Annotation

type Annotation interface {
	Parse(obj client.Object) (interface{}, error)
}

Annotation has a method to parse annotations located in client.Object

Jump to

Keyboard shortcuts

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