svcboot

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReadHeaderTimeout = 5 * time.Second
	DefaultReadTimeout       = 15 * time.Second
	DefaultWriteTimeout      = 15 * time.Second
	DefaultIdleTimeout       = 60 * time.Second
)

Default per-connection timeouts for split API services. Routes that accept large uploads or run long operations (for example the runtime-api registry push) extend their own deadlines with http.ResponseController instead of raising these for every route.

Variables

This section is empty.

Functions

func APIKeySet

func APIKeySet(envValue string) map[string]struct{}

APIKeySet parses comma-separated API keys into a lookup set.

func NewHTTPServer

func NewHTTPServer(addr string, handler http.Handler) *http.Server

NewHTTPServer returns the service HTTP server with the shared default timeouts.

func Run

func Run(cfg Config) error

Run starts metrics, OTEL-instrumented HTTP, and blocks until shutdown.

Types

type Config

type Config struct {
	ServiceName string
	Port        string
	MetricsPort string
	Handler     http.Handler
	OnShutdown  func(context.Context) error
}

Config drives the shared HTTP + metrics + OTEL bootstrap for split API services.

Jump to

Keyboard shortcuts

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