executors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package executors provides abstractions for executing shell scripts remotely

Index

Constants

View Source
const DefaultPort = 22

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionSettings

type ConnectionSettings struct {
	Hostname   string
	Port       int
	Username   string
	PrivateKey []byte
}

ConnectionSettings centralizes attributes related to the remote host settings

type Executor

type Executor interface {
	// Execute connects to a host, runs the script and disconnects
	Execute(ctx context.Context, connection ConnectionSettings, script []byte) error
}

Executor is the interface to provide operations related to script execution

type MockExecutor

type MockExecutor struct {
	mock.Mock
}

MockExecutor is an autogenerated mock type for the Executor type

func NewMockExecutor added in v0.3.0

func NewMockExecutor(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockExecutor

NewMockExecutor creates a new instance of MockExecutor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockExecutor) Execute

func (_m *MockExecutor) Execute(ctx context.Context, connection ConnectionSettings, script []byte) error

Execute provides a mock function with given fields: ctx, connection, script

Directories

Path Synopsis
ssh

Jump to

Keyboard shortcuts

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