Documentation
¶
Index ¶
- Variables
- func AnsibleExecute[I AnsibleExecuteArgs, O AnsibleExecuteReturn](ctx context.Context, connection midtypes.Connection, ...) (O, error)
- func CallAgent[I any, O any](ctx context.Context, connection midtypes.Connection, ...) (rpc.RPCResult[O], error)
- func CanConnect(ctx context.Context, connection midtypes.Connection, ...) (bool, error)
- func ConnectionToSSHClientConfig(connection midtypes.Connection) (*ssh.ClientConfig, string, error)
- func DialWithRetry[T any](ctx context.Context, msg string, maxAttempts int, f func() (T, error)) (T, error)
- func DisconnectAll(ctx context.Context) error
- func PreviewUnreachable(ctx context.Context, connection midtypes.Connection, ...) bool
- func StageFile(ctx context.Context, connection midtypes.Connection, ...) (string, error)
- type AnsibleExecuteArgs
- type AnsibleExecuteReturn
- type ConnectionState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnreachable = errors.New("host is unreachable") ErrHostUnset = errors.New("host is not set in the connection configuration") )
View Source
var AgentPool = syncmap.Map[uint64, *ConnectionState]{}
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 midtypes.Connection, resourceConfig midtypes.ResourceConfig, args I, preview bool, ) (O, error)
func CanConnect ¶ added in v0.0.5
func CanConnect( ctx context.Context, connection midtypes.Connection, resourceConfig midtypes.ResourceConfig, maxAttempts int, ) (bool, error)
func ConnectionToSSHClientConfig ¶ added in v0.0.5
func ConnectionToSSHClientConfig(connection midtypes.Connection) (*ssh.ClientConfig, string, error)
func DialWithRetry ¶ added in v0.0.5
func DisconnectAll ¶ added in v0.0.6
func PreviewUnreachable ¶ added in v0.0.7
func PreviewUnreachable( ctx context.Context, connection midtypes.Connection, resourceConfig midtypes.ResourceConfig, preview bool, ) bool
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 ConnectionState ¶ added in v0.0.6
type ConnectionState struct {
ID uint64
Reachable bool
Unreachable bool
MaxParallel int
TaskCount int
SetupAgentMutex sync.Mutex
CanConnectMutex sync.Mutex
TaskCountMutex sync.Mutex
Agent *midagent.Agent
Connection midtypes.Connection
}
func Acquire ¶ added in v0.0.6
func Acquire( ctx context.Context, connection midtypes.Connection, resourceConfig midtypes.ResourceConfig, ) (*ConnectionState, error)
func (*ConnectionState) FinishedTask ¶ added in v0.0.9
func (cs *ConnectionState) FinishedTask()
func (*ConnectionState) SetupAgent ¶ added in v0.0.6
func (cs *ConnectionState) SetupAgent(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.