fabhttp

package
v0.0.0-...-579b097 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
}

type Options

type Options struct {
	Logger        Logger
	ListenAddress string
	TLS           TLS
}

type Server

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

func NewServer

func NewServer(o Options) *Server

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) HandlerChain

func (s *Server) HandlerChain(h http.Handler, secure bool) http.Handler

func (*Server) Listen

func (s *Server) Listen() (net.Listener, error)

func (*Server) Log

func (s *Server) Log(keyvals ...interface{}) error

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(pattern string, handler http.Handler, secure bool)

RegisterHandler registers into the ServeMux a handler chain that borrows its security properties from the fabhttp.Server. This method is thread safe because ServeMux.Handle() is thread safe, and options are immutable. This method can be called either before or after Server.Start(). If the pattern exists the method panics.

func (*Server) Run

func (s *Server) Run(signals <-chan os.Signal, ready chan<- struct{}) error

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type TLS

type TLS struct {
	Enabled            bool
	CertFile           string
	KeyFile            string
	ClientCertRequired bool
	ClientCACertFiles  []string
}

func (TLS) Config

func (t TLS) Config() (*tls.Config, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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