servers

package
v0.13.10 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	*http.Server
	Listener net.Listener
}

Listener server for using a pre-defined net.Listener

func UnixSocket

func UnixSocket(addr string) (*Listener, error)

UnixSocket returns a new Listener on that address

func (*Listener) SetAddr

func (s *Listener) SetAddr(addr string)

SetAddr sets the servers address, if it hasn't already been set

func (*Listener) Start

func (s *Listener) Start(c context.Context, h http.Handler) error

Start the server

type Server

type Server interface {
	Shutdown(context.Context) error
	Start(context.Context, http.Handler) error
	SetAddr(string)
}

Server allows for custom server implementations

func Wrap

func Wrap(s *http.Server) Server

Wrap converts a standard *http.Server to a buffalo.Server

func WrapListener

func WrapListener(s *http.Server, l net.Listener) Server

WrapListener wraps an *http.Server and a net.Listener

func WrapTLS

func WrapTLS(s *http.Server, certFile string, keyFile string) Server

WrapTLS Server converts a standard *http.Server to a buffalo.Server but makes sure it is run with TLS.

type Simple

type Simple struct {
	*http.Server
}

Simple server

func New

func New() *Simple

New Simple server

func (*Simple) SetAddr

func (s *Simple) SetAddr(addr string)

SetAddr sets the servers address, if it hasn't already been set

func (*Simple) Start

func (s *Simple) Start(c context.Context, h http.Handler) error

Start the server

type TLS

type TLS struct {
	*http.Server
	CertFile string
	KeyFile  string
}

TLS server

func (*TLS) SetAddr

func (s *TLS) SetAddr(addr string)

SetAddr sets the servers address, if it hasn't already been set

func (*TLS) Start

func (s *TLS) Start(c context.Context, h http.Handler) error

Start the server

Jump to

Keyboard shortcuts

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