buffalo: github.com/gobuffalo/buffalo/servers Index | Files

package servers

import "github.com/gobuffalo/buffalo/servers"

Index

Package Files

listener.go servers.go simple.go tls.go

type Listener Uses

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

Listener server for using a pre-defined net.Listener

func UnixSocket Uses

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

UnixSocket returns a new Listener on that address

func (*Listener) SetAddr Uses

func (s *Listener) SetAddr(addr string)

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

func (*Listener) Start Uses

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

Start the server

type Server Uses

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

Server allows for custom server implementations

func Wrap Uses

func Wrap(s *http.Server) Server

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

func WrapListener Uses

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

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

func WrapTLS Uses

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 Uses

type Simple struct {
    *http.Server
}

Simple server

func New Uses

func New() *Simple

New Simple server

func (*Simple) SetAddr Uses

func (s *Simple) SetAddr(addr string)

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

func (*Simple) Start Uses

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

Start the server

type TLS Uses

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

TLS server

func (*TLS) SetAddr Uses

func (s *TLS) SetAddr(addr string)

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

func (*TLS) Start Uses

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

Start the server

Package servers imports 3 packages (graph) and is imported by 3 packages. Updated 2019-06-09. Refresh now. Tools for package owners.