awsx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveAccountID added in v0.16.0

func ResolveAccountID(ctx context.Context, cfg aws.Config, fallback string) string

ResolveAccountID calls STS GetCallerIdentity to determine the AWS account ID. Returns the account ID string on success. If the call fails, it returns the provided fallback value (typically the profile name).

Types

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader wraps AWS SDK configuration loading to allow injection in tests.

func NewLoader

func NewLoader(endpoint string) Loader

NewLoader returns a Loader that uses the default AWS SDK behavior. If endpoint is non-empty, it is applied as the base endpoint for all services.

func NewTestLoader added in v0.16.1

func NewTestLoader(fn loadConfigFunc, endpoint string) Loader

NewTestLoader creates a Loader with a custom load function for testing.

func (Loader) Load

func (l Loader) Load(ctx context.Context, profile, region string) (aws.Config, error)

Load builds an aws.Config using optional profile and region overrides.

type Service

type Service interface {
	Name() string
	Title() string
	Init(ctx context.Context, cfg aws.Config, opts ServiceOptions) (tea.Model, error)
}

Service defines a pluggable AWS-backed UI module.

type ServiceLogger

type ServiceLogger interface {
	Debug(msg string, kv ...interface{})
	Info(msg string, kv ...interface{})
	Error(msg string, kv ...interface{})
}

ServiceLogger is a narrow logging interface used by services.

type ServiceOptions

type ServiceOptions struct {
	Logger    ServiceLogger
	Cache     *cache.Cache
	AccountID string
}

ServiceOptions contains dependencies shared with services.

Jump to

Keyboard shortcuts

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