server

package
v0.0.0-...-37a2e4e Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithAddr

func WithAddr(addr string) Option

func WithCAFile

func WithCAFile(caFile string) Option

func WithCertKeyFiles

func WithCertKeyFiles(certFile, keyFile string) Option

func WithIdleTimeout

func WithIdleTimeout(idleTimeout time.Duration) Option

func WithLogger

func WithLogger(logger *log.Logger) Option

func WithOptions

func WithOptions(options *Options) Option

func WithReadTimeout

func WithReadTimeout(readTimeout time.Duration) Option

func WithWriteTimeout

func WithWriteTimeout(writeTimeout time.Duration) Option

type Options

type Options struct {
	Addr         string
	IdleTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	CertFile     string
	KeyFile      string
	CAFile       string
	// contains filtered or unexported fields
}

type Server

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

func New

func New(handler http.Handler, opts ...Option) (*Server, error)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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