registry

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteExports

func DeleteExports(conn client.Connection, tenantID string) error

DeleteExports deletes all export data for a tenant id

func GetPublicPort

func GetPublicPort(conn client.Connection, key PublicPortKey) (string, string, error)

GetPublicPort returns the service id and application of the public port

func GetPublicPorts

func GetPublicPorts(conn client.Connection) (map[PublicPortKey]PublicPort, error)

func GetVHost

func GetVHost(conn client.Connection, key VHostKey) (string, string, error)

GetVHost returns the service id and application of the vhost

func GetVHosts

func GetVHosts(conn client.Connection) (map[VHostKey]VHost, error)

func RegisterExport

func RegisterExport(shutdown <-chan struct{}, conn client.Connection, tenantID string, export ExportDetails)

RegisterExport exposes an exported endpoint

func SyncServiceRegistry

func SyncServiceRegistry(conn client.Connection, request ServiceRegistrySyncRequest) error

SyncServiceRegistry syncs all vhosts and public ports to those of a matching service.

func TrackExports

func TrackExports(shutdown <-chan struct{}, conn client.Connection, tenantID, application string) <-chan []ExportDetails

TrackExports keeps track of changes to the list of exports for given import

Types

type ExportDetails

type ExportDetails struct {
	service.ExportBinding
	PrivateIP  string
	HostIP     string
	MuxPort    uint16
	InstanceID int
	// contains filtered or unexported fields
}

ExportDetails describes a port binding for an endpoint as it is presented on the coordinator.

func (*ExportDetails) SetVersion

func (node *ExportDetails) SetVersion(version interface{})

SetVersion implements client.Node

func (*ExportDetails) Version

func (node *ExportDetails) Version() interface{}

Version implements client.Node

type ImportListener

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

ImportListener passes matching endpoints to its respective receiver channel

func NewImportListener

func NewImportListener(tenantID string) *ImportListener

NewImportListener instantiates a new listener for a given tenant id.

func (*ImportListener) AddTerm

func (l *ImportListener) AddTerm(matcher StringMatcher) <-chan string

AddTerm adds a search term to the listener and returns a channel receiever with the applicable matches.

func (*ImportListener) Run

func (l *ImportListener) Run(cancel <-chan struct{}, conn client.Connection)

Run starts the export listener for the given tenant

type PublicPort

type PublicPort struct {
	TenantID    string
	Application string
	ServiceID   string // TODO: search by tenant and application
	Protocol    string
	UseTLS      bool
	// contains filtered or unexported fields
}

PublicPort describes a public endpoint

func (*PublicPort) SetVersion

func (node *PublicPort) SetVersion(version interface{})

SetVersion implements client.Node

func (*PublicPort) Version

func (node *PublicPort) Version() interface{}

Version implements client.Node

type PublicPortHandler

type PublicPortHandler interface {
	Enable(port string, protocol string, useTLS bool)
	Disable(port string)
	Set(port string, exports []ExportDetails)
}

PublicPortHandler manages a public port and its exports

type PublicPortKey

type PublicPortKey struct {
	HostID      string
	PortAddress string
}

PublicPortKey points to a specific public port node

type PublicPortListener

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

PublicPortListener listens to ports for a provided ip

func NewPublicPortListener

func NewPublicPortListener(hostID string, handler PublicPortHandler) *PublicPortListener

NewPublicPortListener instantiates a new public port listener for a provided hostID (or master)

func (*PublicPortListener) Done

func (l *PublicPortListener) Done()

Done implements zzk.Listener

func (*PublicPortListener) GetPath

func (l *PublicPortListener) GetPath(nodes ...string) string

GetPath implements zzk.Listener

func (*PublicPortListener) PostProcess

func (l *PublicPortListener) PostProcess(p map[string]struct{})

PostProcess implements zzk.Listener

func (*PublicPortListener) Ready

func (l *PublicPortListener) Ready() error

Ready implements zzk.Listener

func (*PublicPortListener) SetConnection

func (l *PublicPortListener) SetConnection(conn client.Connection)

SetConnection implements zzk.Listener

func (*PublicPortListener) Spawn

func (l *PublicPortListener) Spawn(shutdown <-chan interface{}, portAddr string)

Spawn monitors the public port and its exports

type RegistryError

type RegistryError struct {
	Action  string
	Path    string
	Message string
}

RegistryError describes an error with a registry lookup

func (RegistryError) Error

func (err RegistryError) Error() string

type ServiceRegistrySyncRequest

type ServiceRegistrySyncRequest struct {
	ServiceID       string
	PortsToDelete   []PublicPortKey
	PortsToPublish  map[PublicPortKey]PublicPort
	VHostsToDelete  []VHostKey
	VHostsToPublish map[VHostKey]VHost
}

type StringMatcher

type StringMatcher interface {
	MatchString(string) bool
}

StringMatcher is for matching applications

type Term

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

Term describes a what applications it is looking for and then sends the response.

type VHost

type VHost struct {
	TenantID    string
	ServiceID   string
	Application string
	// contains filtered or unexported fields
}

VHost describes a vhost endpoint

func (*VHost) SetVersion

func (node *VHost) SetVersion(version interface{})

SetVersion implements client.Node

func (*VHost) Version

func (node *VHost) Version() interface{}

Version implements client.Node

type VHostHandler

type VHostHandler interface {
	Enable(name string)
	Disable(name string)
	Set(name string, exports []ExportDetails)
}

VHostHandler manages the vhosts for a host

type VHostKey

type VHostKey struct {
	HostID    string
	Subdomain string
}

VHostKey points to a specific vhost node

type VHostListener

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

VHostListener listens for vhosts on a host

func NewVHostListener

func NewVHostListener(hostID string, handler VHostHandler) *VHostListener

NewVHostListener instantiates a new vhost listener

func (*VHostListener) Done

func (l *VHostListener) Done()

Done implements zzk.Listener

func (*VHostListener) GetPath

func (l *VHostListener) GetPath(nodes ...string) string

GetPath implements zzk.Listener

func (*VHostListener) PostProcess

func (l *VHostListener) PostProcess(p map[string]struct{})

PostProcess implements zzk.Listener

func (*VHostListener) Ready

func (l *VHostListener) Ready() error

Ready implements zzk.Listener

func (*VHostListener) SetConnection

func (l *VHostListener) SetConnection(conn client.Connection)

SetConnection implements zzk.Listener

func (*VHostListener) Spawn

func (l *VHostListener) Spawn(shutdown <-chan interface{}, subdomain string)

Spawn manages a specific vhost for a subdomain

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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