cli

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package cli holds the application struct that service.MainCmd parses CLI args into, plus the Run entry-point that delegates to the injected server factory. The factory itself lives in pkg/factory; this package is import-free of factory to keep the dependency direction (main -> factory -> ...) intact.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Listen     string `arg:"listen"      default:"127.0.0.1:8788"                    env:"LISTEN"      required:"true" usage:"address to listen to"`
	ConfigPath string `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

App is the application wired by main and parsed by service.MainCmd's argument tagger. Exported fields with tags are CLI args; unexported fields are dependencies injected by main.

func NewApp

func NewApp(serverFactory ServerFactory) *App

NewApp constructs the App with the server factory injected.

func (*App) Run

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

Run is invoked by service.MainCmd after argument parsing.

type ServerFactory

type ServerFactory func(listen, configPath string) (librun.Func, error)

ServerFactory is the dep cli requires to start the HTTP listener. Satisfied by factory.CreateServer. Returns the run.Func + any startup error (config load, validation, etc.).

Jump to

Keyboard shortcuts

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