app

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: AGPL-3.0 Imports: 25 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
	DevicePairingService *devicepairing.Service

	HostsService           *hosts.Service
	UserAccessService      *useraccess.Service
	NetworkPoliciesService *networkpolicies.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.

func (*App) RunBackground added in v0.4.0

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

RunBackground starts all application background services except the HTTP server. Blocks until ctx is cancelled or the first non-cancelled error.

Jump to

Keyboard shortcuts

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