config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides centralized AWS configuration shared by all Gopherstack services.

Index

Constants

View Source
const DefaultAccountID = "000000000000"

DefaultAccountID is the default mock AWS account ID used in ARNs.

View Source
const DefaultRegion = "us-east-1"

DefaultRegion is the default AWS region used by Gopherstack mock backends.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalConfig

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

GlobalConfig holds a reference to the shared AWS configuration state. It is thread-safe and can be updated at runtime.

func NewGlobalConfig

func NewGlobalConfig(
	accountID, region string,
	latencyMs int,
	janitorTimeout time.Duration,
	enforceIAM bool,
	autoPurgeTTL time.Duration,
) *GlobalConfig

NewGlobalConfig creates a new GlobalConfig with the given initial state.

func (*GlobalConfig) GetAccountID

func (c *GlobalConfig) GetAccountID() string

GetAccountID returns the mock AWS account ID.

func (*GlobalConfig) GetAutoPurgeTTL

func (c *GlobalConfig) GetAutoPurgeTTL() time.Duration

GetAutoPurgeTTL returns the auto-purge TTL duration.

func (*GlobalConfig) GetJanitorTimeout

func (c *GlobalConfig) GetJanitorTimeout() time.Duration

GetJanitorTimeout returns the per-task janitor timeout.

func (*GlobalConfig) GetLatencyMs

func (c *GlobalConfig) GetLatencyMs() int

GetLatencyMs returns the maximum simulated response latency.

func (*GlobalConfig) GetRegion

func (c *GlobalConfig) GetRegion() string

GetRegion returns the default AWS region.

func (*GlobalConfig) GetStartTime

func (c *GlobalConfig) GetStartTime() time.Time

GetStartTime returns the application startup time.

func (*GlobalConfig) IsIAMEnforced

func (c *GlobalConfig) IsIAMEnforced() bool

IsIAMEnforced returns true if IAM policy enforcement is enabled.

func (*GlobalConfig) Update

func (c *GlobalConfig) Update(
	accountID, region string,
	latencyMs int,
	janitorTimeout time.Duration,
	enforceIAM bool,
	autoPurgeTTL time.Duration,
)

Update updates the configuration state with new values.

type Provider

type Provider interface {
	GetGlobalConfig() *GlobalConfig
}

Provider is implemented by the CLI / any runtime configuration object that can supply a GlobalConfig pointer to services.

Jump to

Keyboard shortcuts

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