Documentation ¶
Index ¶
Constants ¶
View Source
const ( Prefix = "spoditor.io/" Separator = "_" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectorFunc ¶
type CollectorFunc func(metav1.ObjectMetaAccessor) map[QualifiedName]string
func (CollectorFunc) Collect ¶
func (c CollectorFunc) Collect(accessor metav1.ObjectMetaAccessor) map[QualifiedName]string
type Parser ¶
type Parser interface {
Parse(annotations map[QualifiedName]string) (interface{}, error)
}
type ParserFunc ¶
type ParserFunc func(map[QualifiedName]string) (interface{}, error)
func (ParserFunc) Parse ¶
func (p ParserFunc) Parse(annotations map[QualifiedName]string) (interface{}, error)
type PodQualifier ¶
var CommonPodQualifier PodQualifier = func(ordinal int, q string) bool { ll := log.WithValues("ordinal", ordinal, "qualifier", q) if q == "" { ll.Info("pod is always included for dynamic argumentation") return true } bounds := strings.Split(q, "-") if b, err := regexp.MatchString("^\\d+-\\d+$", q); err == nil && b { min, _ := strconv.Atoi(bounds[0]) max, _ := strconv.Atoi(bounds[1]) ll.Info("check ordinal against range", "min", min, "max", max) return ordinal >= min && ordinal <= max } if b, err := regexp.MatchString("^\\d+$", q); err == nil && b { i, _ := strconv.Atoi(bounds[0]) ll.Info("check ordinal against single exact number", "number", i) return ordinal == i } if b, err := regexp.MatchString("^\\d+-$", q); err == nil && b { min, _ := strconv.Atoi(bounds[0]) ll.Info("check ordinal against lower bound", "min", min) return ordinal >= min } if b, err := regexp.MatchString("^-\\d+$", q); err == nil && b { max, _ := strconv.Atoi(bounds[1]) ll.Info("check ordinal against upper bound", "max", max) return ordinal <= max } return false }
type QualifiedAnnotationCollector ¶
type QualifiedAnnotationCollector interface {
Collect(accessor metav1.ObjectMetaAccessor) map[QualifiedName]string
}
var Collector QualifiedAnnotationCollector = defaultCollector
type QualifiedName ¶
Click to show internal directories.
Click to hide internal directories.