run

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 11 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 {
	// contains filtered or unexported fields
}

App is the logr runner. Build it with New(), configure with chained methods, then call .Start().

run.New(myApp.Run).
    LogFile("./logs/api.log").
    OnReady(func() { fmt.Println("ready!") }).
    Start()

func New

func New(runFunc func(ctx context.Context) error) *App

New creates a new App with the given run function as the app entrypoint. Call .Start() to launch — or chain options first.

func (*App) LogFile

func (a *App) LogFile(path string) *App

LogFile sets the log file path the TUI will tail in watch mode. Defaults to ./logs/app.log if not set.

func (*App) OnReady

func (a *App) OnReady(fn func()) *App

OnReady registers a callback invoked once the TUI is ready and tailing. If not set and a run function was provided, it is started automatically.

func (*App) Start

func (a *App) Start()

Start runs the app. It sets up signal handling (Ctrl+C / SIGTERM), wires the logr CLI, and blocks until the app exits. Call this as the last line of main().

func (*App) StartContext

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

StartContext is like Start but uses the provided context. Useful in tests or when you manage the context yourself.

Jump to

Keyboard shortcuts

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