app

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(cfg *config.Config) *App

func (*App) Run

func (app *App) Run() error

func (*App) WithBasePath

func (app *App) WithBasePath(basePath string) *App

WithBasePath sets the base path for all routes and returns the app instance for chaining

func (*App) WithBuildInfo

func (app *App) WithBuildInfo(buildInfo model.BuildInfo) *App

WithBuildInfo sets the build information and returns the app instance for chaining

func (*App) WithLog

func (app *App) WithLog(log *slog.Logger) *App

func (*App) WithObservability

func (app *App) WithObservability(observability *o11.ObservabilityInst) *App

WithObservability allows setting up observability providers (tracing, metrics) and returns the app instance for chaining

func (*App) WithServer

func (app *App) WithServer(server Server) *App

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

type Server

type Server interface {
	Start() error
	Stop(ctx context.Context) error
	Handle(pattern string, handler http.Handler)
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	HandleWithMiddleware(pattern string, handler http.Handler, middlewares ...middleware.Middleware)
	HandleFuncWithMiddleware(pattern string, handler func(http.ResponseWriter, *http.Request), middlewares ...middleware.Middleware)
}

Server defines the interface for any HTTP server implementation This interface is defined in the consumer (app) package

Jump to

Keyboard shortcuts

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