server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructListenAddr

func ConstructListenAddr(addr, port, defaultAddr, defaultPort string) string

ConstructListenAddr return ip:port with defaults.

Types

type HTTPServer

type HTTPServer struct {
	InstanceDesc string
	ListenAddr   string
	RootHandler  http.Handler
	CertManager  certmanager.CertificateManager
	Err          error
	// contains filtered or unexported fields
}

HTTPServer starts HTTP server with root handler using listen address. Implements Runnable interface to be able to stop server.

func (*HTTPServer) Start

func (s *HTTPServer) Start()

func (*HTTPServer) Stop

func (s *HTTPServer) Stop()

Stop shutdowns HTTP server instance and close a done channel. Stop and init may be run in parallel, so initLock is used to wait until variables are initialized.

type Runnable

type Runnable interface {
	Start()
	Stop()
}

type RunnableGroup

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

RunnableGroup is a group of Runnables that should run until one of them stops.

func NewRunnableGroup

func NewRunnableGroup() *RunnableGroup

func (*RunnableGroup) Add

func (rg *RunnableGroup) Add(r Runnable)

Add register Runnable in a group. Note: not designed for parallel registering.

func (*RunnableGroup) Start

func (rg *RunnableGroup) Start()

Start starts all Runnables and stops all of them when at least one Runnable stops.

Jump to

Keyboard shortcuts

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