server

package
v0.0.0-...-35b3a18 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVToMap

func CSVToMap(csv string) map[string]string

CSVToMap converts key1=v1,key2=v2 entries into flat string map

Types

type AppExposer

type AppExposer interface {
	Expose(peer peers.Peer, app peers.App, router messageRouter) error
	Unexpose(peer peers.Peer, app peers.App) error
	Apps() []ExposedApp
	Terminate(peer peers.Peer) error
}

AppExposer is responsible for keeping track of which apps are registered and their endpoints exported

func NewDefaultAppExposer

func NewDefaultAppExposer(portOpenerFactory PortOpenerFactory) AppExposer

NewDefaultAppExposer creates defaultAppExposer instances

type AppListerAdapter

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

AppListerAdapter implements admin.appLister

func NewServerAppsListAdapter

func NewServerAppsListAdapter(exposer AppExposer) *AppListerAdapter

NewServerAppsListAdapter creates ServerAppsListAdapter instances

func (*AppListerAdapter) Apps

func (adapter *AppListerAdapter) Apps() ([]admin.AppListEntry, error)

Apps returns a list of apps

type ExposedApp

type ExposedApp struct {
	App  peers.App
	Peer peers.Peer
}

ExposedApp represents an app exposed on the server along with the peer the app is exposed from

type PortOpenerFactory

type PortOpenerFactory interface {
	Create(app peers.App, peer peers.Peer) (portOpener, error)
}

PortOpenerFactory is a factory interface for portOpener

func NewK8sServicePortOpenerFactory

func NewK8sServicePortOpenerFactory(
	namespace string,
	selectors map[string]string,
	childFactory PortOpenerFactory,
) PortOpenerFactory

NewK8sServicePortOpenerFactory implements PortOpenerFactory as a decorator over existing PortOpenerFactory, that also creates kubernetes service for given opened port

func NewPerAppPortOpenerFactory

func NewPerAppPortOpenerFactory(allocator ports.Allocator) PortOpenerFactory

NewPerAppPortOpenerFactory implements PortOpenerFactory for standard opened TCP connection

type Server

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

Server accepts Peers and opens ports for all the apps connected peers expose

func NewServer

func NewServer(peerFactory peers.PeerFactory, appExposer AppExposer) *Server

NewServer creates Server instances

func (*Server) Start

func (l *Server) Start() error

Start launches the server

Jump to

Keyboard shortcuts

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