webserver

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name          string
	Port          string
	TLSPort       string
	TLSPrivateKey string
	TLSPublicKey  string
	WebRoot       string
	Index         string
	MimeTypes     map[string]string
	DefaultMime   string
	ErrorMime     string
}

* Data structure for web server configuration.

type HttpRequest

type HttpRequest struct {
	Protocol string
	Method   string
	Path     string
	Host     string
	Params   map[string]string
}

* Exchange format for HTTP requests.

type HttpResponse

type HttpResponse struct {
	Header map[string]string
	Body   []byte
}

* Exchange format for HTTP responses.

type WebChannels

type WebChannels struct {
	Requests  chan HttpRequest
	Responses chan HttpResponse
}

* Data structure holding channels for communication between a CGI and the web * server.

type WebServer

type WebServer interface {
	RegisterCgi(path string) WebChannels
	GetCgis() []string
	RemoveCgi(path string)
	Run()
}

* The public interface of the web server.

func CreateWebServer

func CreateWebServer(cfg Config) WebServer

* Creates a new web server.

Jump to

Keyboard shortcuts

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