bootstrap

package
v0.0.0-...-028d67e Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package bootstrap provides the boot-time infrastructure; business modules never import it.

Index

Constants

This section is empty.

Variables

Functions

func Heartbeat

func Heartbeat(i do.Injector) (job.Fn, error)

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

func MigrateCommand

func MigrateCommand(i do.Injector) (*cli.Command, error)

func NewBus

func NewBus(i do.Injector) (event.Bus, error)

func NewCron

func NewCron(i do.Injector) (*cron.Cron, error)

func NewCrypter

func NewCrypter(i do.Injector) (crypt.Crypter, error)

NewCrypter builds the crypter for encrypting values at rest.

func NewMigrate

func NewMigrate(i do.Injector) (*migrate.Migrator, error)

func NewSession

func NewSession(i do.Injector) (*sessions.Manager, error)

func NewSlog

func NewSlog(i do.Injector) (*slog.Logger, error)

NewSlog unwraps the plain *slog.Logger for the rest of the app.

func NewValidator

func NewValidator(i do.Injector) (*validator.Validator, error)

func ProvideDB

func ProvideDB(i do.Injector) (*rio.DB, error)

ProvideDB exposes the plain handle for the data layers.

Types

type Data

type Data struct {
	DB *rio.DB
}

Data owns the database handle for shutdown and /readyz; modules inject the plain *rio.DB instead.

func NewData

func NewData(i do.Injector) (*Data, error)

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

func (*Data) HealthCheck

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

func (*Data) Shutdown

func (d *Data) Shutdown() error

type Logger

type Logger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

Logger owns the rotating writer; inject *slog.Logger everywhere else.

func NewLogger

func NewLogger(i do.Injector) (*Logger, error)

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

func (*Logger) Shutdown

func (l *Logger) Shutdown() error

Jump to

Keyboard shortcuts

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