httpservice

package
v0.0.0-...-cf0bdef Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTLSListener

func CreateTLSListener(opts *TLSOpts, tlsConf *tls.Config) (net.Listener, error)

Types

type HandlerServiceOpts

type HandlerServiceOpts struct {
	Logger        *log.Logger
	Addr          string
	Handler       http.Handler
	WebRoot       string
	ServiceName   string
	Insecure      bool
	Hosts         []string
	CacheDir      string
	UseSelfSigned bool
}

func CreateHandlerServiceOpts

func CreateHandlerServiceOpts(addr string, handler http.Handler) HandlerServiceOpts

type HttpService

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

func (*HttpService) IsRunning

func (r *HttpService) IsRunning() bool

func (*HttpService) Name

func (r *HttpService) Name() string

func (*HttpService) Run

func (r *HttpService) Run() error

func (*HttpService) Stop

func (r *HttpService) Stop(timeout time.Duration) error

type Service

type Service interface {
	Name() string
	IsRunning() bool
	Run() error
	Stop(timeout time.Duration) error
}

func New

func New(name string, server *http.Server, listener net.Listener) Service

func NewHandlerService

func NewHandlerService(opts *HandlerServiceOpts) (Service, error)

type TLSOpts

type TLSOpts struct {
	Addr          string
	Hosts         []string
	CacheDir      string
	UseSelfSigned bool
}

func CreateSelfSignedTLSOpts

func CreateSelfSignedTLSOpts(addr string) TLSOpts

func CreateTLSOpts

func CreateTLSOpts(addr string, certCacheDir string, hosts ...string) TLSOpts

Jump to

Keyboard shortcuts

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