servers

package
v0.0.0-...-5262aa1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HTTP is HTTP/1.1 Clear-Text protocol
	HTTP int = 1
	// HTTPS is HTTP/1.1 Secure (over SSL/TLS) protocol
	HTTPS int = 2
	// H2C is HTTP/2.0 Clear-Text protocol
	H2C int = 3
	// HTTP2 is HTTP/2.0 Secure (over SSL/TLS)
	HTTP2 int = 4
	// HTTP3 is HTTP/2.0 Secure over Quick UDP Internet Connection (QUIC)
	HTTP3 int = 5
	// DNS is Domain Name Service protocol
	DNS int = 6

	// Stopped is the server's state when it has not ever been started
	Stopped int = 0
	// Running means the server is actively accepting connections and serving content
	Running int = 1
	// Error is used when there was an error operating the server
	Error int = 2
	// Closed is used when the server was running but has been stopped; it can't be reused again
	Closed int = 3
)

Variables

View Source
var RegisteredServers = make(map[string]string) // TODO not sure what to do with the value just yet, might change type

RegisteredServers contains an array of registered listener types

Functions

func GetProtocol

func GetProtocol(protocol int) string

GetProtocol is used to transform a server protocol constant into a string for use in written messages or logs

func GetStateString

func GetStateString(state int) string

GetStateString is used to transform a server state constant into a string for use in written messages or logs

Types

type Server

type Server struct {
	ServerInterface
	ID        uuid.UUID   // Unique identifier for the Server object
	Transport interface{} // The server, or transport, that will be used to send and receive traffic
	Interface string      // The network adapter interface the server will listen on
	Port      int         // The port the server will listen on
	Protocol  int         // The protocol (i.e. HTTP/2 or HTTP/3) the server will use from the servers package
	State     int
}

Server structure is used to provide a standard set of fields a server module must support to work with Merlin

type ServerInterface

type ServerInterface interface {
	GetConfiguredOptions() map[string]string
	GetContext() handlers.ContextInterface
	GetInterface() string
	GetProtocol() int
	GetProtocolString() string
	GetPort() int
	SetOption(string, string) error
	Start() error
	Status() int
	Stop() error
}

ServerInterface is used to provide a standard set of methods a server module must support to work with Merlin

type Template

type Template struct {
	Interface string
	Port      string
	Protocol  string
}

Template is a structure used to collect the information needed to create an new server instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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