app

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 52 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 {
	//nolint:containedctx // app-lifetime context threaded through Start via errgroup.WithContext
	Ctx  context.Context
	Stop func()
	Cfg  config.Config
	/* Servers network listeners */
	MASTER net.Listener

	Custom Custom
}

App is the application's top-level dependency container, wiring together config, data sources and servers built during New and started by Start.

func New

func New() (app App, err error)

New builds and returns a fully initialized App: it loads config, wires up every configured data source and server, and runs Custom.Init.

func (*App) InitConfig

func (a *App) InitConfig() (err error)

InitConfig sets up the app's cancellation context and loads its Cfg from config.Init. It is called once by New before any other initializer.

func (*App) InitServers

func (a *App) InitServers() (err error)

InitServers initializes this app's configured dependencies.

func (*App) Start

func (a *App) Start() (err error)

Start runs every configured starter and the custom app logic concurrently, blocking until either one of them fails, they all finish, or an interrupt signal is received, then shuts everything down via closer.Close.

type Custom

type Custom struct {
	Transport *transport.ServersManager
}

func (*Custom) Init

func (c *Custom) Init(a *App) error

func (*Custom) Start

func (c *Custom) Start(ctx context.Context) error

Start - launch custom handlers Even if you won't use it keep it for proper work

func (*Custom) Stop

func (c *Custom) Stop() error

Stop - gracefully stop custom handlers Even if you won't use it keep it for proper work

Jump to

Keyboard shortcuts

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