ssm

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheHostList []schema.Host
)

CacheHostList mirrors the alibaba/tencent/volcengine pattern: cloudlist populates a cache so the REPL `shell <id>` flow can resolve region + OS type without a second API roundtrip.

Functions

func CacheMissingError

func CacheMissingError() error

CacheMissingError exposes the sentinel for tests / callers that need to distinguish "no metadata" from a real API error.

func Close

func Close()

Close ensures the host cache is flushed when callers no longer need it (e.g. across a session reset).

func GetCacheHostList

func GetCacheHostList() []schema.Host

func SetCacheHostList

func SetCacheHostList(hosts []schema.Host)

Types

type Driver

type Driver struct {
	Client *api.Client
	Region string
	// contains filtered or unexported fields
}

func (*Driver) ResolveInstanceContext

func (d *Driver) ResolveInstanceContext(instanceID string) (region, osType string, ok bool)

func (*Driver) RunCommand

func (d *Driver) RunCommand(instanceID, osType, cmd string) string

RunCommand sends `cmd` to instanceID via SSM and polls for completion. Returns the command stdout (or stderr if exit was non-zero). Empty string on hard failure — callers log via logger; the REPL surface is the same as the existing alibaba/tencent ECS exec drivers.

func (*Driver) SetPollOptions

func (d *Driver) SetPollOptions(interval time.Duration, max int, sleep func(time.Duration))

SetPollOptions overrides the default polling cadence. Used by tests; the production driver should keep the defaults (1s interval, ~20 polls).

Jump to

Keyboard shortcuts

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