Documentation ¶
Index ¶
- func DeleteExports(conn client.Connection, tenantID string) error
- func GetPublicPort(conn client.Connection, key PublicPortKey) (string, string, error)
- func GetPublicPorts(conn client.Connection) (map[PublicPortKey]PublicPort, error)
- func GetVHost(conn client.Connection, key VHostKey) (string, string, error)
- func GetVHosts(conn client.Connection) (map[VHostKey]VHost, error)
- func RegisterExport(shutdown <-chan struct{}, conn client.Connection, tenantID string, ...)
- func SyncServiceRegistry(conn client.Connection, request ServiceRegistrySyncRequest) error
- func TrackExports(shutdown <-chan struct{}, conn client.Connection, tenantID, application string) <-chan []ExportDetails
- type ExportDetails
- type ImportListener
- type PublicPort
- type PublicPortHandler
- type PublicPortKey
- type PublicPortListener
- func (l *PublicPortListener) Done()
- func (l *PublicPortListener) GetPath(nodes ...string) string
- func (l *PublicPortListener) PostProcess(p map[string]struct{})
- func (l *PublicPortListener) Ready() error
- func (l *PublicPortListener) SetConnection(conn client.Connection)
- func (l *PublicPortListener) Spawn(shutdown <-chan interface{}, portAddr string)
- type RegistryError
- type ServiceRegistrySyncRequest
- type StringMatcher
- type Term
- type VHost
- type VHostHandler
- type VHostKey
- type VHostListener
- func (l *VHostListener) Done()
- func (l *VHostListener) GetPath(nodes ...string) string
- func (l *VHostListener) PostProcess(p map[string]struct{})
- func (l *VHostListener) Ready() error
- func (l *VHostListener) SetConnection(conn client.Connection)
- func (l *VHostListener) Spawn(shutdown <-chan interface{}, subdomain string)
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 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 ¶
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) 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 ¶
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 ¶
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
type VHostHandler ¶
type VHostHandler interface { Enable(name string) Disable(name string) Set(name string, exports []ExportDetails) }
VHostHandler manages the vhosts for a host
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) 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) 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