resolver

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 3 Imported by: 0

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:

  1. Exact alias match (from aliases map)
  2. Exact Name-tag match (case-insensitive)
  3. Prefix Name-tag match
  4. Instance ID match (i-*)

Returns ErrAmbiguous if more than one instance matches. Returns ErrNotFound if nothing matches.

Types

type ErrAmbiguous

type ErrAmbiguous struct {
	Target  string
	Matches []awsclient.Instance
}

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

Jump to

Keyboard shortcuts

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