source

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	EventType
	Svc    *core.Service
	OldSvc *core.Service
}

Event is an change event to a Kubernetes Service

type EventType

type EventType string

EventType is the type of an event

type Records

type Records struct {
	// contains filtered or unexported fields
}

Records contains mappings from a gRPC service to upstream hosts It holds one upstream for each service version

func NewRecords

func NewRecords() *Records

NewRecords creates an empty mapping

func (*Records) ClearRecords

func (r *Records) ClearRecords()

ClearRecords clears all mappings

func (*Records) GetRecord

func (r *Records) GetRecord(svc, version string) (*url.URL, error)

GetRecord gets a records of the specified (service, version) pair

func (*Records) IsServiceUnique

func (r *Records) IsServiceUnique(svc string) bool

IsServiceUnique checks if there is only one version of a service

func (*Records) RecordExists

func (r *Records) RecordExists(svc, version string) bool

RecordExists checks if a record exists

func (*Records) RemoveRecord

func (r *Records) RemoveRecord(svc, version string, u *url.URL)

RemoveRecord removes a record of the specified (service, version) pair

func (*Records) SetRecord

func (r *Records) SetRecord(svc, version string, u *url.URL) bool

SetRecord sets the backend service URL for the specifiec (service, version) pair. When successful, true will be returned. This fails if the URL for the blank version ("") is to be overwritten, and invalidates that entry.

type Service

type Service struct {
	*Records
	// contains filtered or unexported fields
}

Service watches the Kubernetes API and updates records when there are changes to Service resources

func NewService

func NewService(
	client clientset.Interface,
	namespace string,
	l *zap.Logger) *Service

NewService creates a new Service source

func (*Service) Resolve

func (k *Service) Resolve(svc, version string) (*url.URL, error)

Resolve resolves the FQDN for a backend providing the gRPC service specified

func (*Service) Run

func (k *Service) Run(stopCh <-chan struct{})

Run starts the Service controller

Jump to

Keyboard shortcuts

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