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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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