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
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
Click to show internal directories.
Click to hide internal directories.