config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &ConfigType{}

Functions

func GetHostNames

func GetHostNames() (names []string)

func ListConfigHosts

func ListConfigHosts(name string, user string, tags string) error

func LoadConfig added in v1.0.1

func LoadConfig() error

Types

type ConfigType

type ConfigType struct {
	ModulesDir  string `yaml:"modulesDir,omitempty"`
	SSHAuthSock string `yaml:"sshAuthSock,omitempty"`
}

type Host

type Host struct {
	Patterns      []string
	HostName      string
	Username      string
	Port          uint16
	ProxyJump     string
	TagList       []string
	JumpList      []*Host
	IdentityFiles []string
}

func FilteredHosts added in v1.1.0

func FilteredHosts(name string, user string, tags string) (hosts []*Host, err error)

func GetHostsFromSSHConfig added in v1.1.0

func GetHostsFromSSHConfig() (hosts []*Host, err error)

func NewHost added in v1.1.0

func NewHost(username, hostname string, port uint16, proxyJump string, identityFiles []string) (host *Host, err error)

func (*Host) EndPoint

func (host *Host) EndPoint() string

func (*Host) FillAttrsWithSSHConfig added in v1.1.1

func (host *Host) FillAttrsWithSSHConfig()

func (*Host) JumpString

func (host *Host) JumpString() string

func (*Host) MatchTags added in v1.1.1

func (host *Host) MatchTags(tags []string) bool

func (*Host) Summary added in v1.1.0

func (host *Host) Summary() string

type Task added in v1.1.0

type Task struct {
	Index        int
	Target       *Host
	Command      string
	RemoteListen string
	ProxyServer  string
	Message      string
	Outputer     string
	UploadSrc    string
	UploadDest   string
	DownloadSrc  string
	DownloadDest string
}

func (*Task) ParseCommand added in v1.1.0

func (task *Task) ParseCommand(command, script, module string) error

type TaskConfig added in v1.1.0

type TaskConfig struct {
	Username       string
	Port           uint16
	ProxyJump      string
	IdentityFiles  []string
	Tags           []string
	Targets        []string
	RemoteListen   string
	ProxyServer    string
	Command        string
	Script         string
	Module         string
	UploadSrc      string
	UploadDest     string
	DownloadSrc    string
	DownloadDest   string
	FailedContinue bool
	Parallel       int
	Tasks          []*Task
}

func NewTaskConfig added in v1.1.0

func NewTaskConfig() *TaskConfig

func (*TaskConfig) InitTasks added in v1.1.0

func (cfg *TaskConfig) InitTasks() error

Jump to

Keyboard shortcuts

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