func (s Name) LBSvcProtocolFromService(svc *v1.Service) (hcloud.LoadBalancerServiceProtocol, error) {
	const op = "annotation/Name.LBSvcProtocolFromService"
	var p hcloud.LoadBalancerServiceProtocol
	err := s.applyToValue(op, svc, func(v string) error {
		var err error
		p, err = validateServiceProtocol(v)
		return err
	})
	return p, err
}
LBSvcProtocolFromService retrieves the hcloud.LoadBalancerServiceProtocol
value belonging to the annotation from svc.

LBSvcProtocolFromService returns an error if the value could not be
converted to a hcloud.LoadBalancerServiceProtocol, or the annotation was not
set. In the case of a missing value, the error wraps ErrNotSet.
package annotation
import (
	"errors"
	"fmt"
	"net"
	"strconv"
	"strings"
	"time"
	"github.com/hetznercloud/hcloud-go/hcloud"
	v1 "k8s.io/api/core/v1"
)
var ErrNotSet = errors.New("not set")
type Name string
func (s Name) AnnotateService(svc *v1.Service, v interface{}) error {
	const op = "annotation/Name.AnnotateService"
	if svc.ObjectMeta.Annotations == nil {
		svc.ObjectMeta.Annotations = make(map[string]string)
	}
	k := string(s)
	switch vt := v.(type) {
	case bool:
		svc.ObjectMeta.Annotations[k] = strconv.FormatBool(vt)
	case int:
		svc.ObjectMeta.Annotations[k] = strconv.Itoa(vt)
	case string:
		svc.ObjectMeta.Annotations[k] = vt
	case []string:
		svc.ObjectMeta.Annotations[k] = strings.Join(vt, ",")
	case hcloud.CertificateType:
		svc.ObjectMeta.Annotations[k] = string(vt)
	case []*hcloud.Certificate:
		idsOrNames := make([]string, len(vt))
		for i, c := range vt {
			if c.ID == 0 && c.Name != "" {
				idsOrNames[i] = c.Name
				continue
			}
			idsOrNames[i] = strconv.Itoa(c.ID)
		}
		svc.ObjectMeta.Annotations[k] = strings.Join(idsOrNames, ",")
	case hcloud.NetworkZone:
		svc.ObjectMeta.Annotations[k] = string(vt)
	case hcloud.LoadBalancerAlgorithmType:
		svc.ObjectMeta.Annotations[k] = string(vt)
	case hcloud.LoadBalancerServiceProtocol:
		svc.ObjectMeta.Annotations[k] = string(vt)
	case fmt.Stringer:
		svc.ObjectMeta.Annotations[k] = vt.String()
	default:
		return fmt.Errorf("%s: %v: unsupported type: %T", op, s, v)
	}
	return nil
}
func (s Name) StringFromService(svc *v1.Service) (string, bool) {
	if svc.Annotations == nil {
		return "", false
	}
	v, ok := svc.Annotations[string(s)]
	return v, ok
}
func (s Name) StringsFromService(svc *v1.Service) ([]string, error) {
	const op = "annotation/Name.StringsFromService"
	var ss []string
	err := s.applyToValue(op, svc, func(v string) error {
		ss = strings.Split(v, ",")
		return nil
	})
	return ss, err
}
func (s Name) BoolFromService(svc *v1.Service) (bool, error) {
	const op = "annotation/Name.BoolFromService"
	v, ok := s.StringFromService(svc)
	if !ok {
		return false, fmt.Errorf("%s: %v: %w", op, s, ErrNotSet)
	}
	b, err := strconv.ParseBool(v)
	if err != nil {
		return false, fmt.Errorf("%s: %v: %w", op, s, err)
	}
	return b, nil
}
func (s Name) IntFromService(svc *v1.Service) (int, error) {
	const op = "annotation/Name.IntFromService"
	v, ok := s.StringFromService(svc)
	if !ok {
		return 0, fmt.Errorf("%s: %v: %w", op, s, ErrNotSet)
	}
	i, err := strconv.Atoi(v)
	if err != nil {
		return 0, fmt.Errorf("%s: %v: %w", op, s, err)
	}
	return i, nil
}
func (s Name) IntsFromService(svc *v1.Service) ([]int, error) {
	const op = "annotation/Name.IntsFromService"
	var is []int
	err := s.applyToValue(op, svc, func(v string) error {
		ss := strings.Split(v, ",")
		is = make([]int, len(ss))
		for i, s := range ss {
			iv, err := strconv.Atoi(s)
			if err != nil {
				return err
			}
			is[i] = iv
		}
		return nil
	})
	return is, err
}
func (s Name) IPFromService(svc *v1.Service) (net.IP, error) {
	const op = "annotation/Name.IPFromService"
	var ip net.IP
	err := s.applyToValue(op, svc, func(v string) error {
		ip = net.ParseIP(v)
		if ip == nil {
			return fmt.Errorf("invalid ip address: %s", v)
		}
		return nil
	})
	return ip, err
}
func (s Name) DurationFromService(svc *v1.Service) (time.Duration, error) {
	const op = "annotation/Name.DurationFromService"
	var d time.Duration
	err := s.applyToValue(op, svc, func(v string) error {
		var err error
		d, err = time.ParseDuration(v)
		return err
	})
	return d, err
}