Documentation
¶
Index ¶
- Variables
- func AnsibleExecute[I AnsibleExecuteArgs, O AnsibleExecuteReturn](ctx context.Context, connection *types.Connection, args I, preview bool) (O, error)
- func CallAgent[I any, O any](ctx context.Context, connection *types.Connection, call rpc.RPCCall[I]) (rpc.RPCResult[O], error)
- func CanConnect(ctx context.Context, connection *types.Connection, maxAttempts int) (bool, error)
- func ConnectionToSSHClientConfig(connection *types.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 *types.Connection, preview bool) bool
- func StageFile(ctx context.Context, connection *types.Connection, f io.Reader) (string, error)
- type AnsibleExecuteArgs
- type AnsibleExecuteReturn
- type ConnectionState
Constants ¶
This section is empty.
Variables ¶
View Source
var AgentPool = syncmap.Map[uint64, *ConnectionState]{}
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 CanConnect ¶ added in v0.0.5
func ConnectionToSSHClientConfig ¶ added in v0.0.5
func ConnectionToSSHClientConfig(connection *types.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
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
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
Click to show internal directories.
Click to hide internal directories.