annotations

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2017 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// LBAnnotationKey picks a specific "class" for the specified load balancer.
	LBAnnotationKey = "kubernetes.io/loadbalancer.class"

	// LBEXValue - this controller only processes Services with this annotation.
	LBEXValue = "loadbalancer.lbex"

	// LBEXAlgorithmKey - requested load balancing algorithm
	LBEXAlgorithmKey = "loadbalancer.lbex/algorithm"

	// LBEXMethodKey - Algorithm Least Time has an arugment "Method"
	LBEXMethodKey = "loadbalancer.lbex/method"

	// LBEXHostKey - the load balancer hostname
	LBEXHostKey = "loadbalancer.lbex/host"

	// LBEXResolverKey - DNS Resolver for DNS based service names (if any)
	LBEXResolverKey = "loadbalancer.lbex/resolver"
)

Variables

View Source
var (
	// ErrMissingAnnotations the metatdata does not contains annotations
	ErrMissingAnnotations = errors.New("metatdata without annotations")

	// ErrInvalidAnnotationName the metatdata doesn't contain a valid annotation name
	ErrInvalidAnnotationName = errors.New("invalid annotation name")

	// ErrInvalidAnnotationContent the metadata annotation content is invalid
	ErrInvalidAnnotationContent = errors.New("invalid annotation content")
)

Functions

func GetAlgorithm

func GetAlgorithm(obj interface{}) (string, bool)

GetAlgorithm returns the string value of the annotations, or the empty string if not present, and a bool to indicate wether or not the value was present

func GetBoolAnnotation

func GetBoolAnnotation(name string, obj interface{}) (bool, error)

GetBoolAnnotation extracts a boolean from service annotation

func GetBoolAnnotationAPI

func GetBoolAnnotationAPI(name string, service *api.Service) (bool, error)

GetBoolAnnotationAPI extracts a boolean from an api.Service annotation

func GetHost

func GetHost(obj interface{}) (string, bool)

GetHost returns the string value of the annotations, or the empty string if not present, and a bool to indicate wether or not the value was present

func GetIntAnnotation

func GetIntAnnotation(name string, obj interface{}) (int, error)

GetIntAnnotation extracts an int from an Ingress annotation

func GetMethod

func GetMethod(obj interface{}) (string, bool)

GetMethod returns the string value of the annotations, or the empty string if not present, and a bool to indicate wether or not the value was present

func GetResolver

func GetResolver(obj interface{}) (string, bool)

GetResolver returns the string value of the annotations, or the empty string if not present, and a bool to indicate wether or not the value was present

func GetStringAnnotation

func GetStringAnnotation(name string, obj interface{}) (string, error)

GetStringAnnotation extracts a string from service annotation

func IsInvalidContent

func IsInvalidContent(e error) bool

IsInvalidContent checks the error type

func IsMissingAnnotations

func IsMissingAnnotations(e error) bool

IsMissingAnnotations checks the error type

func IsValid

func IsValid(obj interface{}) bool

IsValid returns true if the given Service object specifies 'lbex' as the value to the loadbalancer.class annotation.

func NewInvalidAnnotationContent

func NewInvalidAnnotationContent(name string, val interface{}) error

NewInvalidAnnotationContent returns a new InvalidContent error

Types

type InvalidContent

type InvalidContent struct {
	Name string
}

InvalidContent error

func (InvalidContent) Error

func (e InvalidContent) Error() string

Jump to

Keyboard shortcuts

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