lifecycle

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AppGraph wires the application.

Functions

This section is empty.

Types

type App

type App struct {
	Server *Server
}

App is the assembled application.

func InitApp

func InitApp() (*App, *loom.Lifecycle, error)

InitApp builds *App from the graph declared by AppGraph.

func NewApp

func NewApp(server *Server) *App

NewApp builds the application.

type Cache

type Cache struct {
	Closed bool
}

Cache is a resource released by a plain func() cleanup.

func NewCache

func NewCache() (*Cache, func())

NewCache returns a plain func() cleanup, which loom adapts.

type Config

type Config struct{ Addr string }

Config holds runtime configuration.

func NewConfig

func NewConfig() *Config

NewConfig loads configuration.

type DB

type DB struct {
	Addr   string
	Closed bool
}

DB is a resource released by a loom.Cleanup.

func NewDB

func NewDB(cfg *Config) (*DB, loom.Cleanup, error)

NewDB opens a database and returns a context-aware cleanup.

type Server

type Server struct {
	DB      *DB
	Cache   *Cache
	Running bool
}

Server registers lifecycle hooks.

func NewServer

func NewServer(lc *loom.Lifecycle, db *DB, cache *Cache) *Server

NewServer wires a server and registers start/stop hooks.

Jump to

Keyboard shortcuts

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