app

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: AGPL-3.0 Imports: 21 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 {
	Config        *config.Conf
	Logger        *slog.Logger
	Database      *database.SQLite
	HTTPServer    http.Handler
	DeviceService *device.Service
	AuthService   *auth.Service
	PolicyService *policy.Service
	RuleService   *rule.Service
	// contains filtered or unexported fields
}

App holds all initialized application components.

func New

func New(ctx context.Context) (*App, error)

New initializes the application with configuration loaded from environment variables.

func NewWithConfigAndLogger

func NewWithConfigAndLogger(ctx context.Context, conf *config.Conf, logger *slog.Logger) (_ *App, err error)

NewWithConfigAndLogger initializes the application with the provided configuration and logger.

func (*App) Close

func (a *App) Close() error

Close cleans up application resources.

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run starts all application background services and the HTTP server. It blocks until shutdown or the first non-cancelled error.

Jump to

Keyboard shortcuts

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