app

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package app assembles a running Certio instance from configuration. Both `certio serve` and every CLI subcommand build the same object graph, so a certificate issued from the terminal is identical to one issued over HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetenv

func MustGetenv(key, fallback string) string

MustGetenv is a small helper for CLI commands that need an environment value.

Types

type App

type App struct {
	Config    *config.Config
	Log       *slog.Logger
	Store     *store.Store
	Service   *service.Service
	Auth      *service.Authenticator
	Scheduler *schedule.Scheduler
	Server    *server.Server
	Version   string
	// contains filtered or unexported fields
}

App holds every long-lived component of a Certio instance.

func New

func New(opts Options) (*App, error)

New builds an instance: configuration, logger, store, keyring and service.

func (*App) Close

func (a *App) Close() error

Close releases the database and flushes the log.

func (*App) Migrate

func (a *App) Migrate() error

Migrate creates the schema and bootstraps the first administrator.

type Options

type Options struct {
	ConfigPath string
	Version    string
	// Commit and Date complete the link-time build stamp; the server reports
	// them on /about.
	Commit string
	Date   string
	// WebFS holds the built SPA to embed. Nil serves the API alone.
	WebFS   fs.FS
	WebRoot string
	// WithServer builds the HTTP layer. CLI commands that talk straight to
	// the database leave it false.
	WithServer bool
}

Options configures how an instance is built.

Jump to

Keyboard shortcuts

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