Documentation
¶
Overview ¶
Package config provides centralized AWS configuration shared by all Gopherstack services.
Index ¶
- Constants
- type GlobalConfig
- func (c *GlobalConfig) GetAccountID() string
- func (c *GlobalConfig) GetAutoPurgeTTL() time.Duration
- func (c *GlobalConfig) GetJanitorTimeout() time.Duration
- func (c *GlobalConfig) GetLatencyMs() int
- func (c *GlobalConfig) GetRegion() string
- func (c *GlobalConfig) GetStartTime() time.Time
- func (c *GlobalConfig) IsIAMEnforced() bool
- func (c *GlobalConfig) Update(accountID, region string, latencyMs int, janitorTimeout time.Duration, ...)
- type Provider
Constants ¶
const DefaultAccountID = "000000000000"
DefaultAccountID is the default mock AWS account ID used in ARNs.
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.
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.