executor

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnreachable = errors.New("host is unreachable")
)
View Source
var Tracer = otel.Tracer("mid/provider/executor")

Functions

func AnsibleExecute added in v0.0.7

func AnsibleExecute[I AnsibleExecuteArgs, O AnsibleExecuteReturn](
	ctx context.Context,
	connection *types.Connection,
	args I,
	preview bool,
) (O, error)

func CallAgent added in v0.0.5

func CallAgent[I any, O any](
	ctx context.Context,
	connection *types.Connection,
	call rpc.RPCCall[I],
) (rpc.RPCResult[O], error)

func CanConnect added in v0.0.5

func CanConnect(ctx context.Context, connection *types.Connection, maxAttempts int) (bool, error)

func ConnectionToSSHClientConfig added in v0.0.5

func ConnectionToSSHClientConfig(connection *types.Connection) (*ssh.ClientConfig, string, error)

func DialWithRetry added in v0.0.5

func DialWithRetry[T any](ctx context.Context, msg string, maxAttempts int, f func() (T, error)) (T, error)

func DisconnectAll added in v0.0.6

func DisconnectAll(ctx context.Context) error

func PreviewUnreachable added in v0.0.7

func PreviewUnreachable(ctx context.Context, connection *types.Connection, preview bool) bool

func StageFile added in v0.0.7

func StageFile(ctx context.Context, connection *types.Connection, f io.Reader) (string, error)

Types

type AnsibleExecuteArgs added in v0.0.7

type AnsibleExecuteArgs interface {
	ToRPCCall() (rpc.RPCCall[rpc.AnsibleExecuteArgs], error)
}

type AnsibleExecuteReturn added in v0.0.7

type AnsibleExecuteReturn interface {
	IsChanged() bool
	GetMsg() string
}

type ConnectionState added in v0.0.6

type ConnectionState struct {
	ID              uint64
	Reachable       bool
	Unreachable     bool
	SetupAgentMutex sync.Mutex
	CanConnectMutex sync.Mutex
	Agent           *midagent.Agent
	Connection      *types.Connection
}

func Acquire added in v0.0.6

func Acquire(ctx context.Context, connection *types.Connection) (*ConnectionState, error)

func (*ConnectionState) SetupAgent added in v0.0.6

func (cs *ConnectionState) SetupAgent(ctx context.Context) error

Jump to

Keyboard shortcuts

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