httpx

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	net.Listener
}

func NewListener

func NewListener(address string, withNextFreePort bool) (*Listener, error)

func (Listener) GetPort

func (l Listener) GetPort() int

type Option

type Option func(*Options)

func HttpsRedirect

func HttpsRedirect(redirect bool) Option

func WithPortRoll

func WithPortRoll(roll bool) Option

func WithServerConfig

func WithServerConfig(conf shared.Server) Option

func WithZone

func WithZone(zone string) Option

type Options

type Options struct {
	Https                bool
	HttpsRedirect        bool
	HttpsRedirectAddress string
	HttpsCert            string
	HttpsKey             string
	HttpsDomain          string
	PortRoll             bool
	IdleTimeout          time.Duration
	ReadTimeout          time.Duration
	WriteTimeout         time.Duration
	Zone                 string
}

func (*Options) IsAutoHttpsCert

func (o *Options) IsAutoHttpsCert() bool

type Server

type Server struct {
	http.Server
	service.RunnableService
	// contains filtered or unexported fields
}

func NewServer

func NewServer(address string, handler func(*Server) http.Handler, options ...Option) (*Server, error)

func (*Server) GetHost

func (s *Server) GetHost() string

func (*Server) GetProtocol

func (s *Server) GetProtocol() string

func (*Server) Run

func (s *Server) Run()

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) (err error)

type TLS

type TLS struct {
	CertManager *autocert.Manager
}

func NewTLSConfig

func NewTLSConfig(host string) *TLS

Jump to

Keyboard shortcuts

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