bootstrap

package
v0.0.0-...-5a3423c Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bootstrap provides the boot-time infrastructure providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseHealthCheck

func DatabaseHealthCheck(data *Data) registry.HealthCheck

func Heartbeat

func Heartbeat(log *slog.Logger) job.Fn

Heartbeat is an example job; replace it with real ones.

func MigrateCommand

func MigrateCommand(m *migrate.Migrator) *cli.Command

func NewBus

func NewBus(log *slog.Logger) event.Bus

func NewCron

func NewCron(log *slog.Logger, jobs registry.Jobs) (*cron.Cron, error)

func NewCrypter

func NewCrypter(config *conf.Config) (crypt.Crypter, error)

NewCrypter builds the crypter for encrypting values at rest.

func NewLogger

func NewLogger(config *conf.Config) (*slog.Logger, func() error, error)

NewLogger builds the logger writing to a rotated file, stdout, or both.

func NewMigrate

func NewMigrate(db *rio.DB, c *migrate.Collection, log *slog.Logger) (*migrate.Migrator, error)

func NewSession

func NewSession(config *conf.Config, log *slog.Logger, db *rio.DB) (*sessions.Manager, func() error, error)

func NewValidator

func NewValidator(config *conf.Config) (*validator.Validator, error)

func ProvideDB

func ProvideDB(data *Data) *rio.DB

ProvideDB exposes the plain handle for the data layers.

Types

type Data

type Data struct {
	DB *rio.DB
}

Data owns the database handle; modules inject the plain *rio.DB.

func NewData

func NewData(config *conf.Config, log *slog.Logger) (*Data, func() error, error)

NewData opens the database (swap SQLite for MySQL/PostgreSQL freely).

func (*Data) HealthCheck

func (d *Data) HealthCheck(ctx context.Context) error

Jump to

Keyboard shortcuts

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