cli

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientCommand = &cli.Command{
	Name:  "client",
	Usage: "NodeISP Management Client",
	Action: func(ctx context.Context, cmd *cli.Command) error {
		return client.Run()
	},
}
View Source
var ConfigFlag = &cli.StringFlag{
	Name:        "config",
	Aliases:     []string{"c"},
	Usage:       "Load configuration from `FILE`",
	Sources:     cli.EnvVars("NODEISP_CONFIG"),
	Value:       "/etc/node-isp/config.yaml",
	Destination: &config.File,
}
View Source
var RootCommand = &cli.Command{
	Name:    "node-isp",
	Usage:   "Building blocks for your own ISP",
	Version: version.Version,
	Flags: []cli.Flag{
		ConfigFlag,
	},
	Commands: []*cli.Command{
		SetupCommand,
		ServerCommand,
		ClientCommand,
	},
}
View Source
var ServerCommand = &cli.Command{
	Name:  "server",
	Usage: "NodeISP Server",
	Action: func(ctx context.Context, cmd *cli.Command) error {

		_, err := os.Stat(config.File)
		if os.IsNotExist(err) {
			c := SetupCommand
			c.Flags = append(c.Flags, ConfigFlag)
			return SetupCommand.Run(ctx, os.Args)
		}

		return server.Run()
	},
}
View Source
var SetupCommand = &cli.Command{
	Name:  "setup",
	Usage: "Setup NodeISP for the first time",
	Action: func(ctx context.Context, cmd *cli.Command) error {
		return setup.Run()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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