Documentation ¶
Index ¶
- Constants
- Variables
- func AddServers(rsc *Resource, svc *api.Service, en *api.Endpoints, port api.ServicePort)
- func CreateFullController(kind string, w Updater, c cache.Getter, sel Selector, resync time.Duration) (cache.Store, *framework.Controller)
- func CreateStore(kind string, c cache.Getter, sel Selector, resync time.Duration, ...) (cache.Store, error)
- func CreateUpdateController(kind string, w Updater, c cache.Getter, sel Selector, resync time.Duration) (cache.Store, *framework.Controller)
- func GenResourceID(namespace, name string, port intstr.IntOrString) string
- func GenServerID(namespace, name, ip string, port int) string
- func GetServicePort(svc *api.Service, port intstr.IntOrString) (api.ServicePort, bool)
- func HasServiceIP(s *api.Service) bool
- func Sort(list ResourceList, fn func(a, b *Resource) bool)
- func Status(client *Client) error
- type Cache
- func (k *Cache) GetEndpoints(client unversioned.Interface, namespace, name string) (*api.Endpoints, error)
- func (k *Cache) GetIngress(client unversioned.ExtensionsInterface, namespace, name string) (*extensions.Ingress, error)
- func (k *Cache) GetService(client unversioned.Interface, namespace, name string) (*api.Service, error)
- func (k *Cache) MapServiceToIngress(namespace, serviceName, ingressName string)
- func (k *Cache) ServiceDeleted(namespace, name string)
- func (k *Cache) SetEndpointsStore(store cache.Store)
- func (k *Cache) SetIngressStore(store cache.Store)
- func (k *Cache) SetServiceStore(store cache.Store)
- type Client
- type Endpoints
- type Ingress
- type Resource
- func (r *Resource) AddServer(id, scheme, ip string, port int)
- func (r *Resource) GetAnnotation(key string) (val string, ok bool)
- func (r *Resource) GetAnnotations(expr string) (map[string]string, error)
- func (r *Resource) ID() string
- func (r *Resource) IsWebsocket() bool
- func (r *Resource) NoServers() bool
- func (r *Resource) Servers() ServerList
- func (r Resource) String() string
- type ResourceList
- type Route
- func (r *Route) AddHeader(header, value string) error
- func (r *Route) AddHost(host string) error
- func (r *Route) AddMethod(method string) error
- func (r *Route) AddPath(path string) error
- func (r *Route) AddPrefix(pre string) error
- func (r *Route) Empty() bool
- func (r *Route) Parts() []*routePart
- func (r Route) String() string
- type Selector
- type Server
- type ServerList
- type Service
- type SuperClient
- type Updater
Constants ¶
View Source
const ( Add = "ADD" Update = "UPDATE" Delete = "DELETE" ServiceKind = "service" ServicesKind = "services" IngressKind = "ingress" IngressesKind = "ingresses" EndpointsKind = "endpoints" HostPart = "host" PathPart = "path" PrefixPart = "prefix" MethodPart = "method" HeaderPart = "header" HostKey = "host" PathKey = "path" PrefixKey = "prefix" MethodsKey = "methods" HeadersKey = "headers" HTTP = "http" HTTPS = "https" TCP = "tcp" )
Variables ¶
View Source
var (
ByID = func(a, b *Resource) bool { return a.id < b.id }
)
View Source
var (
Keyspace string
)
Functions ¶
func AddServers ¶
func CreateFullController ¶
func CreateStore ¶
func CreateUpdateController ¶
func GenResourceID ¶
func GenResourceID(namespace, name string, port intstr.IntOrString) string
func GenServerID ¶
func GetServicePort ¶
func GetServicePort(svc *api.Service, port intstr.IntOrString) (api.ServicePort, bool)
func HasServiceIP ¶
func Sort ¶
func Sort(list ResourceList, fn func(a, b *Resource) bool)
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a convenience struct so we can pass around all our various caches
func (*Cache) GetEndpoints ¶
func (*Cache) GetIngress ¶
func (k *Cache) GetIngress(client unversioned.ExtensionsInterface, namespace, name string) (*extensions.Ingress, error)
func (*Cache) GetService ¶
func (*Cache) MapServiceToIngress ¶
func (*Cache) ServiceDeleted ¶
func (*Cache) SetEndpointsStore ¶
func (*Cache) SetIngressStore ¶
func (*Cache) SetServiceStore ¶
type Client ¶
type Client struct {
*unversioned.Client
}
func (*Client) GetDiscoveryClient ¶
func (c *Client) GetDiscoveryClient() *unversioned.DiscoveryClient
func (*Client) GetExtensionsClient ¶
func (c *Client) GetExtensionsClient() *unversioned.ExtensionsClient
func (*Client) GetUnversionedClient ¶
func (c *Client) GetUnversionedClient() *unversioned.Client
type Ingress ¶
type Ingress extensions.Ingress
type Resource ¶
type Resource struct { *Route // contains filtered or unexported fields }
Resource is a single loadbalancer Resource or service pulled out of kubernetes objects
func NewResource ¶
NewResource returns a Resource pointer given an id, annotations and an annotations namespace which should be ServicePort.Name
func (*Resource) GetAnnotations ¶
func (*Resource) IsWebsocket ¶
func (*Resource) Servers ¶
func (r *Resource) Servers() ServerList
type ResourceList ¶
type ResourceList []*Resource
func GenResources ¶
func GenResources(store *Cache, client SuperClient, obj interface{}) (ResourceList, error)
GenResources parses a given kubernetes object and returns a ResourceList or an error if the object is not a Service, Endpoints or Ingress. Returned ResourceList can be empty.
func (ResourceList) Map ¶
func (r ResourceList) Map() map[string]*Resource
func (ResourceList) String ¶
func (r ResourceList) String() string
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) IsWebsocket ¶
type ServerList ¶
type ServerList []*Server
func (ServerList) String ¶
func (s ServerList) String() string
type Service ¶
func (Service) IsFrontend ¶
type SuperClient ¶
type SuperClient interface { unversioned.Interface unversioned.ExtensionsInterface }
SuperClient is a convenience interface that includes unversioned.Interface & ExtensionsInterface
Click to show internal directories.
Click to hide internal directories.