serverapp

package
v0.5.9-rc.2 Latest Latest
Warning

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

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

Documentation

Overview

Package serverapp wires and runs the Dexaflow control plane: the HTTP API, auth, metrics, and (when enabled) the scheduler. cmd/dexaflow-server is a thin caller of it (ADR 0099).

Index

Constants

This section is empty.

Variables

View Source
var ErrDatabaseReplaced = errors.New("the database was replaced under this process (another installation id, none, or no schema); " +
	"exiting so no cache outlives the old database: the restart waits, not ready, until the right database is back or this one is accepted with installation.id")

ErrDatabaseReplaced stops a running server whose readiness probe found another installation's database, or none, under it.

Functions

func ExitCode

func ExitCode(err error) int

ExitCode is the process exit code for what Run returned.

func LogEnvCompat

func LogEnvCompat(r envcompat.Report)

LogEnvCompat reports the result of mirroring the environment: every conflicting pair (the DEXAFLOW_* value won) and, in one line, how many variables are set only under their LEOFLOW_* names, which keep working.

func Run

func Run(ctx context.Context, opts Options) error

Run builds every component and serves until ctx is done. A nil opts.Config is loaded the way the binary loads it: the config file named by DEXAFLOW_CONFIG (or LEOFLOW_CONFIG), then the environment. Its error maps to the process exit code through ExitCode.

func VersionOutput

func VersionOutput() string

VersionOutput is what `dexaflow-server version` prints: the version line every existing parser reads ("<name> <version> ..."), then the capabilities. It is answered before any config is loaded, so probing a binary never boots it.

Types

type Options

type Options struct {
	// Config is the configuration to run with. Nil loads it the way the
	// binary does.
	Config *config.ServerConfig
	// ConfigFile, when set and Config is nil, is the config file to read in
	// place of the one DEXAFLOW_CONFIG names. The environment still applies
	// on top of it.
	ConfigFile string
	// AdmissionHooks run before the configured webhook, in this order
	// (ADR 0100 §6).
	AdmissionHooks []admission.Hook
	// LogSink, when set, stores task logs in place of the sink logs.backend
	// would build (ADR 0099 §3). The caller owns it: the server never closes
	// it.
	LogSink logs.Sink
	// XComBackend, when set, stores XCom values in place of Redis or the
	// embedded Postgres store (ADR 0099 §3). Redis, when configured, still
	// serves the live log tail. The caller owns the backend.
	XComBackend xcom.Backend
	// UIServer, when set, is served in place of the embedded SPA (ADR 0099
	// §3).
	UIServer api.UIServer
	// Authenticator, when set, checks the request tokens the engine's own
	// authenticator does not recognize and takes password sign-in (ADR 0099
	// §3, §6).
	Authenticator auth.Authenticator
	// TrustedIssuer, when set, verifies trusted-issuer handoffs posted from
	// TrustedIssuerOrigins in place of auth.trusted_issuer, which must then be
	// empty.
	TrustedIssuer        api.TrustedIssuer
	TrustedIssuerOrigins []string
}

Options are the components a caller of pkg/server supplies instead of, or next to, the ones the configuration builds.

Jump to

Keyboard shortcuts

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