discovk8s

package
v0.0.0-...-552ec7c Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver() resolver.Builder

func RegisterResolver

func RegisterResolver()

Types

type Client

type Client struct {
	ClientSet       *kubernetes.Clientset
	InformerFactory informers.SharedInformerFactory
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

type EndpointController

type EndpointController interface {
	AddOnUpdateFunc(serviceName string, updateFunc OnUpdateFunc)
	GetEndpoints(serviceName string, namespace string) ([]*ServiceInstance, error)
}

func NewEndpointController

func NewEndpointController(client *Client) (EndpointController, error)

type K8sSubscriber

type K8sSubscriber struct {
	Subscriber
	// contains filtered or unexported fields
}

func (*K8sSubscriber) OnUpdate

func (s *K8sSubscriber) OnUpdate()

func (*K8sSubscriber) SetUpdateFunc

func (s *K8sSubscriber) SetUpdateFunc(f func())

func (*K8sSubscriber) Values

func (s *K8sSubscriber) Values() []string

type OnUpdateFunc

type OnUpdateFunc func(addresses []*ServiceInstance)

type Registry

type Registry interface {
	NewSubscriber(service *Service) Subscriber
}

func NewRegistry

func NewRegistry(controller EndpointController) Registry

type Service

type Service struct {
	Name      string
	Namespace string
	Port      int32
}

func (*Service) EndpointName

func (s *Service) EndpointName() string

type ServiceInstance

type ServiceInstance struct {
	Ip   string
	Port int32
}

func (*ServiceInstance) FullName

func (s *ServiceInstance) FullName() string

type ServiceInstanceSlice

type ServiceInstanceSlice []*ServiceInstance

func (ServiceInstanceSlice) Len

func (s ServiceInstanceSlice) Len() int

func (ServiceInstanceSlice) Less

func (s ServiceInstanceSlice) Less(i, j int) bool

func (ServiceInstanceSlice) Swap

func (s ServiceInstanceSlice) Swap(i, j int)

type Subscriber

type Subscriber interface {
	SetUpdateFunc(func())
	OnUpdate()
	Values() []string
}

Jump to

Keyboard shortcuts

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