server

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Overview

Package server wires runakefli's components together and runs them until the context ends, then shuts them down in order: HTTP (draining in-flight requests), the ruler, the background loops and the ClickHouse connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateSchema

func MigrateSchema(ctx context.Context, cfg *config.Config, logger log.Logger) error

MigrateSchema migrates the ClickHouse schema to the current version (runakefli -schema.migrate). Every other runakefli instance must be stopped.

func Run

func Run(ctx context.Context, cfg *config.Config, opts Options) error

Run starts runakefli and blocks until ctx is done or the HTTP server fails. In-flight requests run on a context that is not cancelled by ctx; they get server.graceful_shutdown_timeout to finish.

Types

type Options

type Options struct {
	Logger log.Logger
	// Listening, when set, is called with the bound HTTP address before
	// systemd is notified (tests listen on port 0).
	Listening func(net.Addr)
}

Options are the process-level hooks Run needs besides the config.

Jump to

Keyboard shortcuts

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