server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

An Option modifies the config.

func WithHost

func WithHost(host string) Option

WithHost sets the host to bind in the config.

func WithPort

func WithPort(port int) Option

WithPort sets the port in the config.

func WithTLSPort

func WithTLSPort(port int) Option

WithTLSPort sets the TLS port in the config.

type RoutingTable

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

A RoutingTable contains the information needed to route a request.

func NewRoutingTable

func NewRoutingTable(payload *watcher.Payload) *RoutingTable

NewRoutingTable creates a new RoutingTable.

func (*RoutingTable) GetBackend

func (rt *RoutingTable) GetBackend(host, path string) (*url.URL, error)

GetBackend gets the backend for the given host and path.

func (*RoutingTable) GetCertificate

func (rt *RoutingTable) GetCertificate(sni string) (*tls.Certificate, error)

GetCertificate gets a certificate.

type Server

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

A Server serves HTTP pages.

func New

func New(options ...Option) *Server

New creates a new Server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run runs the server.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves an HTTP request.

func (*Server) Update

func (s *Server) Update(payload *watcher.Payload)

Update updates the server with new ingress rules.

Jump to

Keyboard shortcuts

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