cmd

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codegen

type Codegen struct {
	Output string `` /* 159-byte string literal not displayed */
	Lang   string `` /* 146-byte string literal not displayed */
}

func (*Codegen) Run

func (c *Codegen) Run(logger *slog.Logger) error

Run is called by Kong when the codegen command is executed.

type ConfigCommand

type ConfigCommand struct {
	Init ConfigInit `cmd:"" help:"Generate a configuration template"`
}

ConfigCommand groups config-related subcommands.

type ConfigInit

type ConfigInit struct {
	Command string `arg:"" name:"command" help:"Command to generate config for" enum:"server,proxy"`
	Format  string `help:"Output format" enum:"json,yaml,toml" default:"json"`
	Output  string `help:"Destination file path (defaults to current directory)"`
	Force   bool   `help:"Overwrite if the file already exists"`
}

ConfigInit scaffolds a configuration file for a specific command.

func (*ConfigInit) Run

func (c *ConfigInit) Run() error

Run generates a configuration template dynamically via reflection of the command structs and tags.

type Install added in v0.3.0

type Install struct{}

Install sets up VIIPER to run automatically.

func (*Install) Run added in v0.3.0

func (c *Install) Run(logger *slog.Logger) error

type Proxy

type Proxy struct {
	ListenAddr        string        `help:"Proxy listen address" default:":3241" env:"VIIPER_PROXY_ADDR"`
	UpstreamAddr      string        `help:"Upstream USB-IP server address" required:"" env:"VIIPER_PROXY_UPSTREAM"`
	ConnectionTimeout time.Duration `help:"Connection timeout" default:"30s" env:"VIIPER_PROXY_TIMEOUT"`
}

func (*Proxy) Run

func (p *Proxy) Run(logger *slog.Logger, rawLogger log.RawLogger) error

Run is called by Kong when the proxy command is executed.

type Server

type Server struct {
	UsbServerConfig   usb.ServerConfig `embed:"" prefix:"usb."`
	ApiServerConfig   api.ServerConfig `embed:"" prefix:"api."`
	ConnectionTimeout time.Duration    `help:"ConnectionTimeout operation timeout" default:"30s" env:"VIIPER_CONNECTION_TIMEOUT"`
}

func (*Server) Run

func (s *Server) Run(logger *slog.Logger, rawLogger log.RawLogger) error

Run is called by Kong when the server command is executed.

func (*Server) StartServer

func (s *Server) StartServer(ctx context.Context, logger *slog.Logger, rawLogger log.RawLogger) error

type Uninstall added in v0.3.0

type Uninstall struct{}

Uninstall removes VIIPER startup configuration.

func (*Uninstall) Run added in v0.3.0

func (c *Uninstall) Run(logger *slog.Logger) error

Jump to

Keyboard shortcuts

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