libhost

package
v0.0.0-...-cc6e817 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMatchesFromYAML

func LoadMatchesFromYAML(r io.Reader, label, hostname string) ([]HostConfig, []HostConfig, error)

LoadMatchesFromYAML reads the yaml configuration reader source and returns a slice of hosts that matches the given labels and also a slice with all hosts from the yaml file

Types

type HostConfig

type HostConfig struct {
	ConfigFile      string            `yaml:"ConfigFile"`
	DeviceType      string            `yaml:"DeviceType"`
	EnablePassword  string            `yaml:"EnablePassword"`
	ExecMode        bool              `yaml:"ExecMode"`
	Filename        string            `yaml:"FileName"`
	Hostname        string            `yaml:"Hostname"`
	KeyFile         string            `yaml:"KeyFile"`
	KnownHosts      string            `yaml:"KnownHosts"`
	Labels          map[string]string `yaml:"Labels"`
	Password        string            `yaml:"Password"`
	ReadTimeout     time.Duration     `yaml:"Readtimeout"`
	ScriptFile      string            `yaml:"ScriptFile"`
	SpeedMode       bool              `yaml:"SpeedMode"`
	SSHIP           string            `yaml:"SSHIP"`
	SSHPort         int               `yaml:"SSHPort"`
	StrictHostCheck bool              `yaml:"StrictHostCheck"`
	Username        string            `yaml:"Username"`
	WriteTimeout    time.Duration     `yaml:"Writetimeout"`
}

HostConfig represents the host structure, that is being imported from the yaml configuration

func LoadAllFromYAML

func LoadAllFromYAML(r io.Reader) ([]HostConfig, error)

LoadAllFromYAML reads a yaml configuration reader source and returns a slice of hosts

func LoadMatchesFromSlice

func LoadMatchesFromSlice(allHosts []HostConfig, label string) ([]HostConfig, error)

LoadMatchesFromSlice reads the allHosts slice and returns a slice of hosts that matches the given labels

func (*HostConfig) ApplyCliSettings

func (h *HostConfig) ApplyCliSettings(scriptFile, configFile string, writeTimeout time.Duration, readTimeout time.Duration, HostCheck bool, KeyFile string, HostFile string)

ApplyCliSettings overwrites given cli parameters/set defaults

func (HostConfig) MatchLabels

func (h HostConfig) MatchLabels(userLabels string) bool

MatchLabels checks the given labels on the command line and returns true or false

Jump to

Keyboard shortcuts

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