Documentation ¶
Index ¶
- Constants
- Variables
- func GetAlgorithm(obj interface{}) (string, bool)
- func GetBoolAnnotation(name string, obj interface{}) (bool, error)
- func GetBoolAnnotationAPI(name string, service *api.Service) (bool, error)
- func GetHost(obj interface{}) (string, bool)
- func GetIntAnnotation(name string, obj interface{}) (int, error)
- func GetMethod(obj interface{}) (string, bool)
- func GetResolver(obj interface{}) (string, bool)
- func GetStringAnnotation(name string, obj interface{}) (string, error)
- func IsInvalidContent(e error) bool
- func IsMissingAnnotations(e error) bool
- func IsValid(obj interface{}) bool
- func NewInvalidAnnotationContent(name string, val interface{}) error
- type InvalidContent
Constants ¶
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 ¶
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 ¶
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 ¶
GetBoolAnnotation extracts a boolean from service annotation
func GetBoolAnnotationAPI ¶
GetBoolAnnotationAPI extracts a boolean from an api.Service annotation
func GetHost ¶
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 ¶
GetIntAnnotation extracts an int from an Ingress annotation
func GetMethod ¶
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 ¶
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 ¶
GetStringAnnotation extracts a string from service annotation
func IsMissingAnnotations ¶
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 ¶
NewInvalidAnnotationContent returns a new InvalidContent error
Types ¶
type InvalidContent ¶
type InvalidContent struct {
Name string
}
InvalidContent error
func (InvalidContent) Error ¶
func (e InvalidContent) Error() string