cli

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Overview

Package cli implements the functionality for running proxydhcp as a CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFlags added in v0.3.0

func RegisterFlags(c *Config, fs *flag.FlagSet)

RegisterFlags registers CLI flags for the proxydhcp comand.

func SupportedBins

func SupportedBins(_ context.Context, opts ...Option) *ffcli.Command

SupportedBins returns the command for printing the arch to iPXE binary mapping.

Types

type Config added in v0.3.0

type Config struct {
	LogLevel        string `vname:"-loglevel" validate:"oneof=debug info"`
	TFTPAddr        string `vname:"-remote-tftp" validate:"required,hostname_port"`
	HTTPAddr        string `vname:"-remote-http" validate:"required,hostname_port"`
	IPXEAddr        string `vname:"-remote-ipxe" validate:"required,url"`
	IPXEScript      string `vname:"-ipxe-script" validate:"required"`
	ProxyAddr       string `vname:"-proxy-addr" validate:"required,ip"`
	CustomUserClass string
	Log             logr.Logger
}

Config is the configuration for the proxydhcp command.

func ProxyDHCP

func ProxyDHCP(_ context.Context) (*ffcli.Command, *Config)

ProxyDHCP returns the CLI command and Config struct for the proxydhcp command.

type Option

type Option func(*bin)

Option for setting optional Client values.

func WithFlagSet

func WithFlagSet(flagSet *flag.FlagSet) Option

WithFlagSet adds a flag set to the command.

func WithName

func WithName(name string) Option

WithName sets the name of the command.

func WithOptions

func WithOptions(opts ...ff.Option) Option

WithOptions adds command options to the command.

func WithShortUsage

func WithShortUsage(shortUsage string) Option

WithShortUsage sets the short usage of the command.

func WithUsageFunc

func WithUsageFunc(usageFunc func(*ffcli.Command) string) Option

WithUsageFunc sets the usage function for the command.

Jump to

Keyboard shortcuts

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