app

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IServices

type IServices interface {
	ServeServices(string, string, chan<- net.Conn) // Retrieve all Services and serve
	GetRunningServices() RunningServices           // Get all running Services
	GetServiceServers(string) []string             // Get all servers' address that a service runs on
	ConnectToServer(string) (net.Conn, error)      // Connect to a service running locally
	ServeStatic(string, int) (string, string)      // Serve static Services, and return their port numbers
}

func InitServices

func InitServices() IServices

type RunningServices

type RunningServices map[string][]string

A map to store running services, the key represents local server, and the value as the remote server's address

type Server

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

func NewServer

func NewServer(connCh chan<- net.Conn) *Server

func (*Server) Serve

func (s *Server) Serve()

type Services

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

func (*Services) ConnectToServer

func (s *Services) ConnectToServer(addr string) (net.Conn, error)

Connect to a service running locally

func (*Services) GetRunningServices

func (s *Services) GetRunningServices() RunningServices

Get all running Services

func (*Services) GetServiceServers

func (s *Services) GetServiceServers(remoteAddr string) []string

Get a service's port number using the remote address

func (*Services) ServeServices

func (s *Services) ServeServices(conoidHost, conoidPort string, connCh chan<- net.Conn)

Retrieve all Services and serve

func (*Services) ServeStatic

func (s *Services) ServeStatic(dir string, port int) (string, string)

Serve static Services, and return their port numbers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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