https

package
v4.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPSServer

func NewHTTPSServer(handler http.Handler, cfg *SSL, cfgHTTP2 *HTTP2, errLog *log.Logger, logger *zap.Logger) (servers.InternalServer[any], error)

Types

type ClientAuthType

type ClientAuthType string
const (
	NoClientCert               ClientAuthType = "no_client_cert"
	RequestClientCert          ClientAuthType = "request_client_cert"
	RequireAnyClientCert       ClientAuthType = "require_any_client_cert"
	VerifyClientCertIfGiven    ClientAuthType = "verify_client_cert_if_given"
	RequireAndVerifyClientCert ClientAuthType = "require_and_verify_client_cert"
)

type HTTP2

type HTTP2 struct {

	// H2C enables HTTP/2 over TCP
	H2C bool

	// MaxConcurrentStreams defaults to 128.
	MaxConcurrentStreams uint32 `mapstructure:"max_concurrent_streams"`
}

HTTP2 HTTP/2 server customizations.

func (*HTTP2) EnableHTTP2

func (h2 *HTTP2) EnableHTTP2() bool

func (*HTTP2) InitDefaults

func (h2 *HTTP2) InitDefaults() error

InitDefaults sets default values for HTTP/2 configuration.

type SSL

type SSL struct {
	// Address to listen as HTTPS server, defaults to 0.0.0.0:443.
	Address string
	// ACME configuration
	Acme *acme.Config `mapstructure:"acme"`
	// Redirect when enabled forces all http connections to switch to https.
	Redirect bool
	// Key defined private server key.
	Key string
	// Cert is https certificate.
	Cert string
	// Root CA file
	RootCA string `mapstructure:"root_ca"`
	// mTLS auth
	AuthType ClientAuthType `mapstructure:"client_auth_type"`

	// internal
	Port int
	// contains filtered or unexported fields
}

SSL defines https server configuration.

func (*SSL) EnableACME

func (s *SSL) EnableACME() bool

func (*SSL) InitDefaults

func (s *SSL) InitDefaults() error

func (*SSL) Valid

func (s *SSL) Valid() error

type Server

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

func (*Server) Serve added in v4.4.1

func (s *Server) Serve(mdwr map[string]common.Middleware, order []string) error

func (*Server) Server added in v4.4.1

func (s *Server) Server() any

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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