config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config provides shared configuration constants and region helpers for the refresh CLI. Per-invocation configuration (timeouts, concurrency) flows through urfave/cli flags and their environment variables; this package only holds the defaults those flags reference.

Index

Constants

View Source
const (
	// DefaultTimeout is the default operation timeout for API calls.
	DefaultTimeout = 60 * time.Second

	// DefaultMaxConcurrency is the default maximum number of concurrent operations.
	DefaultMaxConcurrency = 8

	// DefaultPollInterval is the default interval for polling update status.
	DefaultPollInterval = 15 * time.Second

	// DefaultUpdateTimeout is the default timeout for AMI update operations.
	DefaultUpdateTimeout = 40 * time.Minute

	// DefaultCacheTTL is the default time-to-live for cached data.
	DefaultCacheTTL = 5 * time.Minute

	// DefaultListCacheTTL is the TTL for list operation cache.
	DefaultListCacheTTL = 2 * time.Minute
)

Default configuration values following Go best practices for constants.

View Source
const (
	EnvTimeout        = "REFRESH_TIMEOUT"
	EnvMaxConcurrency = "REFRESH_MAX_CONCURRENCY"
	EnvEKSRegions     = "REFRESH_EKS_REGIONS"
)

Environment variable names as constants for type safety and refactoring.

Variables

This section is empty.

Functions

func ChinaRegions added in v0.3.0

func ChinaRegions() []string

ChinaRegions returns the list of EKS-supported China regions.

func DefaultEKSRegions added in v0.3.0

func DefaultEKSRegions() []string

DefaultEKSRegions returns the default list of EKS-supported regions for the commercial AWS partition.

func GetRegionsForPartition added in v0.3.0

func GetRegionsForPartition(currentRegion string) []string

GetRegionsForPartition returns the appropriate regions based on the current AWS partition detected from the provided region.

func GovCloudRegions added in v0.3.0

func GovCloudRegions() []string

GovCloudRegions returns the list of EKS-supported GovCloud regions.

func RegionsFromEnv

func RegionsFromEnv() []string

RegionsFromEnv parses REFRESH_EKS_REGIONS environment variable (comma-separated). Returns nil if the environment variable is not set or empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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