core

package
v0.0.0-...-7a1b787 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(options *libs.Options)

InitConfig Init the config

func SampleConnect

func SampleConnect(host string) error

func WriteConfig

func WriteConfig(wks WorkerPool, options libs.Options) error

Types

type Runner

type Runner struct {
	Host          string
	SSHPrivateKey string
	SSHUser       string
	PassPhrase    string
	Commands      []string

	BackOff *backoff.ExponentialBackOff
	Client  *goph.Client

	Opt libs.Options
}

func InitProvider

func InitProvider(host string, opt libs.Options) (Runner, error)

InitProvider init provider object to easier interact with cloud provider

func (*Runner) Action

func (r *Runner) Action(action string) (err error)

func (*Runner) Connect

func (r *Runner) Connect() error

func (*Runner) RunCommnad

func (r *Runner) RunCommnad(cmd string) (err error)

func (*Runner) Start

func (r *Runner) Start() error

type Worker

type Worker struct {
	Name string `yaml:"name" json:"name"`
	Host string `yaml:"host" json:"host"`
	Port string `yaml:"port" json:"port"`
	User string `yaml:"user" json:"user"`

	Key        string `yaml:"key" json:"key"`
	PassPhrase string `yaml:"passphrase" json:"passphrase"`
}

func ValidateWorker

func ValidateWorker(host string, opt libs.Options) (wk Worker, err error)

type WorkerPool

type WorkerPool struct {
	Workers []Worker `yaml:"workers" json:"workers"`
}

func GetConfig

func GetConfig(options libs.Options) (WorkerPool, error)

GetConfig load config

Jump to

Keyboard shortcuts

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