engin

package
v0.0.0-...-09a0bf3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterruptibleReader

func NewInterruptibleReader(ctx context.Context, r io.Reader) io.Reader

func SetInternalFunc

func SetInternalFunc(name string, f internalFunc)

func UploadFileWithFs

func UploadFileWithFs(f fs.FS) internalFunc

Types

type Config

type Config struct {
	SSHConfigs []SSHConfig
	Commands   []string
}

func NewDefaultConfig

func NewDefaultConfig(remotes []parser.Remote, commands []string) Config

type Engin

type Engin struct {
	// contains filtered or unexported fields
}

func New

func New(path string, l *slog.Logger) (*Engin, error)

func NewWithConfig

func NewWithConfig(script *parser.RScript, l *slog.Logger) *Engin

func NewWithConfigAndContext

func NewWithConfigAndContext(ctx context.Context, config *parser.RScript, l *slog.Logger) *Engin

func (*Engin) Close

func (e *Engin) Close() error

func (*Engin) Run

func (e *Engin) Run()

func (*Engin) SetSendResult

func (e *Engin) SetSendResult(sendResultF ...func(result ProgressResult))

type InterruptibleReader

type InterruptibleReader func(p []byte) (n int, err error)

func (InterruptibleReader) Read

func (r InterruptibleReader) Read(p []byte) (n int, err error)

type ProgressMsg

type ProgressMsg struct {
	Name    string  `json:"name"`
	Msg     string  `json:"msg"`
	Percent float64 `json:"percent"`
	Time    string  `json:"time"`
}

type ProgressResult

type ProgressResult struct {
	ProgressMsg

	Err    string `json:"err"`
	Result string `json:"result"`
}

type SSHConfig

type SSHConfig struct {
	User     string
	Password string
	Host     string
	Port     uint16
	// contains filtered or unexported fields
}

SSHConfig holds the configuration for SSH connection

Jump to

Keyboard shortcuts

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