server

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ShutdownTimeout is the overall ceiling for stopping the server graph.
	// Each component also gets its own smaller budget so one slow stop cannot
	// consume the time reserved for components behind it.
	ShutdownTimeout = 6 * time.Minute
)

Variables

This section is empty.

Functions

func LocalClientAddress

func LocalClientAddress(log *slog.Logger, address string) string

LocalClientAddress returns a loopback address for a client connecting to a server that listens on all interfaces.

func NormalizeServerAddress

func NormalizeServerAddress(log *slog.Logger, address string) string

NormalizeServerAddress adds the default port when an address does not name one explicitly. Server binding and local client configuration both use this path so they cannot disagree about where the API is listening.

Types

type Runtime

type Runtime struct {
	ControlPlane *coordinate.ControlPlane
	Runner       *runner.Runner
	// contains filtered or unexported fields
}

Runtime owns the started server graph and its top-level services.

func Start

func Start(options StartOptions) (*Runtime, error)

Start assembles, validates, and starts the server dependency graph.

func (*Runtime) Log

func (r *Runtime) Log() *slog.Logger

Log returns the system-log-enabled logger produced during server boot.

func (*Runtime) Stop

func (r *Runtime) Stop(ctx context.Context) error

type StartOptions

type StartOptions struct {
	Log     *slog.Logger
	Context context.Context
	Group   *errgroup.Group
	Config  *serverconfig.Config
}

StartOptions contains the resolved inputs used to assemble one fixed server boot graph.

Jump to

Keyboard shortcuts

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