servicecmd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: EUPL-1.2 Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOverrides

func ApplyOverrides(cfg *buildservice.Config, req Request) core.Result

ApplyOverrides applies request-level service overrides to a config.

Example:

cfg := buildservice.Config{ProjectDir: projectDir}
err := servicecmd.ApplyOverrides(&cfg, servicecmd.Request{Name: "core-build"})
Example
_ = ApplyOverrides(nil, Request{})
core.Println("ApplyOverrides")
Output:
ApplyOverrides

func LoadConfig

func LoadConfig(req Request, getwd func() core.Result, resolve func(string) core.Result) core.Result

LoadConfig resolves, overrides, and normalizes a service config for a request.

Example:

cfg, err := servicecmd.LoadConfig(req, ax.Getwd, buildservice.ResolveConfig)
if err != nil {
	return err
}
Example
_ = LoadConfig(Request{}, func() core.Result {
	return core.Ok("")
}, func(string) core.Result {
	return core.Ok(buildservice.Config{})
})
core.Println("LoadConfig")
Output:
LoadConfig

func ParseCSV

func ParseCSV(value string) []string

ParseCSV splits comma-separated service option values and drops blank entries.

Example:

paths := servicecmd.ParseCSV("src, .core/build.yaml")
cfg.WatchPaths = paths
Example
_ = ParseCSV("agent")
core.Println("ParseCSV")
Output:
ParseCSV

Types

type Request

type Request struct {
	Name             string
	DisplayName      string
	Description      string
	ProjectDir       string
	Output           string
	Format           string
	APIAddr          string
	HealthAddr       string
	PIDFile          string
	WatchPaths       string
	WatchInterval    string
	ScheduleInterval string
	AutoRebuild      bool
	AutoRebuildSet   bool
}

Request bundles the inputs the `core service install/start/stop/status` commands need: project layout (Name/ProjectDir/Output/Format), networking (APIAddr/HealthAddr/PIDFile), and watcher tuning (WatchPaths/WatchInterval).

req := servicecmd.Request{Name: "myapp", ProjectDir: ".", APIAddr: ":7300"}

func FromOptions

func FromOptions(opts core.Options) Request

FromOptions returns a service request decoded from CLI options.

Example:

req := servicecmd.FromOptions(opts)
err := runServiceInstall(req)
Example

--- v0.9.0 generated usage examples ---

_ = FromOptions(core.NewOptions())
core.Println("FromOptions")
Output:
FromOptions

Jump to

Keyboard shortcuts

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