configflags

package
v0.0.0-...-5dcfad9 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	User          string   `json:"user" mapstructure:"user"`
	Password      string   `json:"password" mapstructure:"password"`
	AskPass       bool     `json:"ask-pass" mapstructure:"ask-pass"`
	PassFile      string   `json:"pass-file" mapstructure:"pass-file"`
	IdentityFiles []string `json:"identity-files" mapstructure:"identity-files"`
	Passphrase    string   `json:"passphrase" mapstructure:"passphrase"`
	VaultPassFile string   `json:"vault-pass-file" mapstructure:"vault-pass-file"`
}

Auth config.

func NewAuth

func NewAuth() *Auth

NewAuth ...

func (*Auth) AddFlagsTo

func (a *Auth) AddFlagsTo(fs *pflag.FlagSet)

AddFlagsTo pflagSet.

func (*Auth) Complete

func (a *Auth) Complete() error

Complete some flags value.

func (*Auth) Validate

func (a *Auth) Validate() (errs []error)

Validate flags.

type ConfigFlags

type ConfigFlags struct {
	Auth    *Auth    `json:"auth" mapstructure:"auth"`
	Hosts   *Hosts   `json:"hosts" mapstructure:"hosts"`
	Run     *Run     `json:"run" mapstructure:"run"`
	Output  *Output  `json:"output" mapstructure:"output"`
	Proxy   *Proxy   `json:"proxy" mapstructure:"proxy"`
	Timeout *Timeout `json:"timeout" mapstructure:"timeout"`
}

ConfigFlags is cli flags that also in config file.

var Config *ConfigFlags

Config instance.

func New

func New() *ConfigFlags

New config flags.

func (*ConfigFlags) AddFlagsTo

func (c *ConfigFlags) AddFlagsTo(flags *pflag.FlagSet)

AddFlagsTo flagset.

func (*ConfigFlags) Complete

func (c *ConfigFlags) Complete() error

Complete ...

func (*ConfigFlags) String

func (c *ConfigFlags) String() string

String ...

func (*ConfigFlags) Validate

func (c *ConfigFlags) Validate() (errs []error)

Validate ...

type Hosts

type Hosts struct {
	Inventory string `json:"inventory" mapstructure:"inventory"`
	Port      int    `json:"port" mapstructure:"port"`
	List      bool   `json:"list" mapstructure:"list"`
}

Hosts ...

func NewHosts

func NewHosts() *Hosts

NewHosts ...

func (*Hosts) AddFlagsTo

func (h *Hosts) AddFlagsTo(fs *pflag.FlagSet)

AddFlagsTo pflagSet.

func (*Hosts) Complete

func (h *Hosts) Complete() error

Complete ...

func (*Hosts) Validate

func (h *Hosts) Validate() (errs []error)

Validate ...

type Output

type Output struct {
	File     string `json:"file" mapstructure:"file"`
	JSON     bool   `json:"json" mapstructure:"json"`
	Condense bool   `json:"condense" mapstructure:"condense"`
	Quiet    bool   `json:"quiet" mapstructure:"quiet"`
	Verbose  bool   `json:"verbose" mapstructure:"verbose"`
}

Output ...

func NewOutput

func NewOutput() *Output

NewOutput ...

func (*Output) AddFlagsTo

func (o *Output) AddFlagsTo(flags *pflag.FlagSet)

AddFlagsTo flagset.

func (*Output) Complete

func (o *Output) Complete() error

Complete ...

func (*Output) Validate

func (o *Output) Validate() (errs []error)

Validate ...

type Proxy

type Proxy struct {
	Server        string   `json:"server" mapstructure:"server"`
	Port          int      `json:"port" mapstructure:"port"`
	User          string   `json:"user" mapstructure:"user"`
	Password      string   `json:"password" mapstructure:"password"`
	IdentityFiles []string `json:"identity-files" mapstructure:"identity-files"`
	Passphrase    string   `json:"passphrase" mapstructure:"passphrase"`
}

Proxy config.

func NewProxy

func NewProxy() *Proxy

NewProxy ...

func (*Proxy) AddFlagsTo

func (p *Proxy) AddFlagsTo(fs *pflag.FlagSet)

AddFlagsTo pflagSet.

func (*Proxy) Complete

func (p *Proxy) Complete() error

Complete some flags value.

func (*Proxy) Validate

func (p *Proxy) Validate() (errs []error)

Validate flags.

type Run

type Run struct {
	Sudo        bool   `json:"sudo" mapstructure:"sudo"`
	AsUser      string `json:"as-user" mapstructure:"as-user"`
	Lang        string `json:"lang" mapstructure:"lang"`
	Concurrency int    `json:"concurrency" mapstructure:"concurrency"`
}

Run ...

func NewRun

func NewRun() *Run

NewRun ...

func (*Run) AddFlagsTo

func (r *Run) AddFlagsTo(flags *pflag.FlagSet)

AddFlagsTo ...

func (*Run) Complete

func (r *Run) Complete() error

Complete ...

func (*Run) Validate

func (r *Run) Validate() (errs []error)

Validate ...

type Timeout

type Timeout struct {
	Conn    int `json:"conn" mapstructure:"conn"`
	Command int `json:"command" mapstructure:"command"`
	Task    int `json:"task" mapstructure:"task"`
}

Timeout ...

func NewTimeout

func NewTimeout() *Timeout

NewTimeout ...

func (*Timeout) AddFlagsTo

func (t *Timeout) AddFlagsTo(flags *pflag.FlagSet)

AddFlagsTo ...

func (*Timeout) Complete

func (t *Timeout) Complete() error

Complete ...

func (*Timeout) Validate

func (t *Timeout) Validate() (errs []error)

Validate ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳