server

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(logger *zerolog.Logger, err error, msg string)

func Start

func Start[Server httpServer](parent task.Parent, srv Server, acl *acl.Config, logger *zerolog.Logger)

Types

type CertProvider added in v0.11.2

type CertProvider interface {
	GetCert(*tls.ClientHelloInfo) (*tls.Certificate, error)
}

type Options

type Options struct {
	Name         string
	HTTPAddr     string
	HTTPSAddr    string
	CertProvider CertProvider
	Handler      http.Handler
	ACL          *acl.Config
}

type Server

type Server struct {
	Name         string
	CertProvider CertProvider
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opt Options) (s *Server)

func StartServer

func StartServer(parent task.Parent, opt Options) (s *Server)

func (*Server) Start

func (s *Server) Start(parent task.Parent)

Start will start the http and https servers.

If both are not set, this does nothing.

Start() is non-blocking.

func (*Server) Uptime

func (s *Server) Uptime() time.Duration

Jump to

Keyboard shortcuts

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