cmd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package cmd is the entry-point package for the supervisor daemon. After the cmd/ subdirectory was removed, all entry-point code lives here: it owns the root flag parser, the cross-subcommand Options struct (--configuration / --daemon / --env-file) and the Run() helper invoked by the repo-root main.go. All actual implementation lives in the setup/ctl/svc subpackages under internal/.

Index

Constants

View Source
const Version = "v1.2.0"

Variables

This section is empty.

Functions

func ReapZombie

func ReapZombie()

func Run

func Run()

Run is the entry point invoked by the repo-root main.go. It reaps zombies (linux only), then parses CLI flags. When no subcommand is given it either daemonizes (--daemon) or runs the supervisor in the foreground via svc.NewServer().Run().

Types

type BaseChecker

type BaseChecker struct {
	// contains filtered or unexported fields
}

func NewBaseChecker

func NewBaseChecker(includes []string, timeout int) *BaseChecker

func (*BaseChecker) Check

func (bc *BaseChecker) Check() bool

func (*BaseChecker) Write

func (bc *BaseChecker) Write(b []byte) (int, error)

type ContentChecker

type ContentChecker interface {
	Check() bool
}

type HttpChecker

type HttpChecker struct {
	// contains filtered or unexported fields
}

func NewHttpChecker

func NewHttpChecker(url string, timeout int) *HttpChecker

func (*HttpChecker) Check

func (hc *HttpChecker) Check() bool

type Options

type Options struct {
	Configuration string `short:"c" long:"configuration" description:"the configuration file"`
	Daemon        bool   `short:"d" long:"daemon" description:"run as daemon"`
	EnvFile       string `long:"env-file" description:"the environment file"`
}

Options mirrors the legacy root-package flag struct. Kept here so the global go-flags parser can bind flags at the root level before dispatching to subcommands.

func GetOptions

func GetOptions() *Options

GetOptions returns the root-package Options pointer so other packages (e.g. ctl) can read the daemon-mode flag values without depending on the unexported global directly.

type ScriptChecker

type ScriptChecker struct {
	// contains filtered or unexported fields
}

func NewScriptChecker

func NewScriptChecker(args []string) *ScriptChecker

func (*ScriptChecker) Check

func (sc *ScriptChecker) Check() bool

type SetupCommand

type SetupCommand = setup.Command

SetupCommand is a type alias for setup.Command so that go-flags reflection sees the same positional/flag tags and Execute method, while keeping the `*SetupCommand` symbol used elsewhere in this package unchanged. The actual implementation lives in the github.com/gwaysys/supd/internal/setup package.

type TcpChecker

type TcpChecker struct {
	// contains filtered or unexported fields
}

func NewTcpChecker

func NewTcpChecker(host string, port int, includes []string, timeout int) *TcpChecker

func (*TcpChecker) Check

func (tc *TcpChecker) Check() bool

type TemplateCommand

type TemplateCommand struct{}

TemplateCommand prints the supported supd configuration template to stdout. Previously known as InitTemplateCommand, the rename reflects the fact that it no longer writes to a file -- it just dumps the template so users can pipe it to `tee` / redirect / grep as desired.

func (*TemplateCommand) Execute

func (x *TemplateCommand) Execute(args []string) error

Execute prints the configuration template to stdout. With no flag or positional arguments the go-flags parser invokes Execute directly and the entire template is emitted on a single stdout write.

type VersionCommand

type VersionCommand struct {
}

func (VersionCommand) Execute

func (v VersionCommand) Execute(args []string) error

Jump to

Keyboard shortcuts

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