Documentation
¶
Overview ¶
Package resolver resolves instance targets from names, tags, and bookmarks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
func Resolve(target string, instances []awsclient.Instance, aliases map[string]string) (*awsclient.Instance, error)
Resolve finds the single Instance that best matches target, consulting aliases first, then EC2 Name tags, then instance IDs.
Resolution order:
- Exact alias match (from aliases map)
- Exact Name-tag match (case-insensitive)
- Prefix Name-tag match
- Instance ID match (i-*)
Returns ErrAmbiguous if more than one instance matches. Returns ErrNotFound if nothing matches.
Types ¶
type ErrAmbiguous ¶
ErrAmbiguous is returned when multiple instances match the target.
func (*ErrAmbiguous) Error ¶
func (e *ErrAmbiguous) Error() string
type ErrNotFound ¶
type ErrNotFound struct {
Target string
}
ErrNotFound is returned when no instance matches the target.
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
Click to show internal directories.
Click to hide internal directories.