cli

package
v0.0.0-...-dc1b42f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLI struct {
	Deploy DeployCmd `cmd:"" help:"Deploy new directory. Use the PC6_CONFIG environment variable to define a non-default config path."`
}

Functions

func Run

func Run()

Types

type Config

type Config struct {
	AppName   string
	DeployDir string
	AppDir    string
	Addresses []string
	PreCmds   []string
	ExecStart string
	PostCmds  []string
	User      string
	PortEnv   string
	New       bool
	Own       bool
}

type DeployCmd

type DeployCmd struct {
	AppName              string   `arg:""`
	DeployDir            string   `required:"" group:"app" short:"d" help:"The source directory to deploy."`
	AppDir               string   `required:"" group:"app" short:"p" help:"The pc6 app directory."`
	Addresses            []string `required:"" group:"app" short:"a" help:"The address matcher(s) to serve the app off of."`
	ExecStart            string   `required:"" default:"" group:"app" short:"x" help:"The command to start the app."`
	SetupCmds            []string `group:"app" help:"Commands to execute once before starting the app. Will not be run on an app restart."`
	PreCmds              []string `group:"app" help:"Commands to execute every time the app is (re)started, before the run command."`
	PostCmds             []string `group:"app" help:"Commands to execute every time the app is (re)started, after the run command."`
	User                 string   `required:"" group:"app" short:"u" default:"root" help:"The user to run the commands as."`
	PortEnv              string   `required:"" default:"PORT" group:"app" short:"P" help:"Environment variable used by process to set it's port."`
	CreateUser           bool     `required:"" group:"app" short:"" default:"no" help:"Creates user if it does not already exist."`
	ForceDirs            bool     `` /* 141-byte string literal not displayed */
	Static               bool     `required:"" group:"app" short:"s" default:"no" help:"Serves the files directly of a Caddy file server."`
	Caddyfile            string   `required:"" group:"app" short:"c" default:"./Caddyfile" help:"Where the caddyfile is located. Defaults to ./Caddyfile."`
	EnvironmentVariables []string `group:"app" help:"A map of environment variables of form \"KEY=VALUE\"."`
}

type Resolver

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

func (*Resolver) Resolve

func (r *Resolver) Resolve(kctx *kong.Context, parent *kong.Path, flag *kong.Flag) (interface{}, error)

func (*Resolver) Validate

func (r *Resolver) Validate(app *kong.Application) error

Jump to

Keyboard shortcuts

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