server

package
v0.0.0-...-fd822e1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: MIT Imports: 9 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 {
	ReadTimeout       time.Duration
	ReadHeaderTimeout time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
	MaxHeaderBytes    int
	ErrorLog          *log.Logger
}

type LetsEncryptConfig

type LetsEncryptConfig struct {
	AcceptTOS bool
	Email     string
	CachePath string
}

type Route

type Route struct {
	Handler  http.Handler
	Patterns []string
}

type Server

type Server struct {
	LetsEncrypt LetsEncryptConfig
	Routes      []Route
	Config
}

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context, httpAddress string) error

func (*Server) ListenAndServeTLS

func (s *Server) ListenAndServeTLS(ctx context.Context, httpAddress, httpsAddress string) error

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, httpListener net.Listener) error

func (*Server) ServeTLS

func (s *Server) ServeTLS(ctx context.Context, httpListener, httpsListener net.Listener) error

Jump to

Keyboard shortcuts

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