app

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package app is the apiserver composition root: it wires the FX modules and owns the application lifecycle. It is internal because it is the only place allowed to depend on Uber FX; the public github.com/.../pkg/apiserver package is a thin, FX-free wrapper over it.

Index

Constants

View Source
const (
	// DefaultServerStartTimeout = 30 * time.Second.
	DefaultServerStartTimeout = 30 * time.Second

	// DefaultServerStopTimeout is the default timeout for stopping the server.
	DefaultServerStopTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

func NewConfigModule

func NewConfigModule(settings *config.ServerSettings) fx.Option

NewConfigModule creates a new module for configuration.

func VisualizeError

func VisualizeError(err error) (string, error)

VisualizeError renders an FX dependency-graph error into a human-readable form. It is exposed so callers outside the composition root can pretty-print startup failures without importing FX directly.

Types

type Server

type Server struct {
	*fx.App
	// contains filtered or unexported fields
}

Server is a struct that represents the server application. It embeds the fx.App struct from the Uber Fx framework.

func New

func New(settings config.ServerSettings) *Server

New creates a new instance of the Server struct.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the server and blocks until the context is done.

Jump to

Keyboard shortcuts

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