Documentation
¶
Index ¶
- type Config
- func (c *Config) Read() error
- func (c *Config) Save() error
- func (c *Config) SetDynamoDBActionRetries(i uint) error
- func (c *Config) SetDynamoDBAwsRegion(s string) error
- func (c *Config) SetDynamoDBDaxUrl(s string) error
- func (c *Config) SetDynamoDBTable(s string) error
- func (c *Config) SetDynamoDBTimeoutSeconds(i uint) error
- func (c *Config) SetDynamoDBUseDax(b bool) error
- func (c *Config) SetGatewayKey(s string) error
- func (c *Config) SetHashKeys(hk ...HashKeyData) error
- func (c *Config) SetHealthReportCleanUpFrequencySeconds(i uint) error
- func (c *Config) SetHealthReportRecordStaleMinutes(i uint) error
- func (c *Config) SetServiceDiscoveryTimeoutSeconds(i uint) error
- type HashKeyData
- type NotifierGatewayData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AppName string `mapstructure:"-"`
ConfigFileName string `mapstructure:"-"`
CustomConfigPath string `mapstructure:"-"`
NotifierGatewayData *NotifierGatewayData `mapstructure:"notifier_gateway"`
// contains filtered or unexported fields
}
func (*Config) Read ¶
Read will load config settings from disk. FIX #2: Builds into local variables first and only overwrites c._v and c.NotifierGatewayData on success, so a failed Read() doesn't destroy previously valid state. FIX #3: Validates required fields (DynamoDBAwsRegion, DynamoDBTable) after unmarshal so callers get a clear error instead of a confusing downstream AWS SDK failure.
func (*Config) Save ¶
Save persists config settings to disk. FIX #6: Returns an error when _v is nil instead of silently succeeding.
func (*Config) SetDynamoDBActionRetries ¶
func (*Config) SetDynamoDBAwsRegion ¶
func (*Config) SetDynamoDBDaxUrl ¶
func (*Config) SetDynamoDBTable ¶
func (*Config) SetDynamoDBTimeoutSeconds ¶
func (*Config) SetDynamoDBUseDax ¶
func (*Config) SetGatewayKey ¶
func (*Config) SetHashKeys ¶ added in v1.0.8
func (c *Config) SetHashKeys(hk ...HashKeyData) error
FIX #4: Trim key names and secrets before storing so that lookups using trimmed names (e.g. model.GetHashKey("mykey")) match correctly.
func (*Config) SetHealthReportCleanUpFrequencySeconds ¶ added in v1.0.8
func (*Config) SetHealthReportRecordStaleMinutes ¶ added in v1.0.8
func (*Config) SetServiceDiscoveryTimeoutSeconds ¶ added in v1.0.8
type HashKeyData ¶ added in v1.7.1
type HashKeyData struct {
HashKeyName string `mapstructure:"hash_key_name"`
HashKeySecret string `mapstructure:"hash_key_secret"`
}
FIX #7: Exported so other packages can construct HashKeyData values to pass to SetHashKeys.
type NotifierGatewayData ¶ added in v1.7.1
type NotifierGatewayData struct {
DynamoDBAwsRegion string `mapstructure:"dynamodb_aws_region"`
DynamoDBUseDax bool `mapstructure:"dynamodb_use_dax"`
DynamoDBDaxUrl string `mapstructure:"dynamodb_dax_url"`
DynamoDBTable string `mapstructure:"dynamodb_table"`
DynamoDBTimeoutSeconds uint `mapstructure:"dynamodb_timeout_seconds"`
DynamoDBActionRetries uint `mapstructure:"dynamodb_action_retries"`
GatewayKey string `mapstructure:"gateway_key"`
ServiceDiscoveryTimeoutSeconds uint `mapstructure:"service_discovery_timeout_seconds"`
HealthReportCleanUpFrequencySeconds uint `mapstructure:"health_report_cleanup_frequency_seconds"`
HealthReportRecordStaleMinutes uint `mapstructure:"health_report_record_stale_minutes"`
HashKeys []HashKeyData `mapstructure:"hash_keys"`
}
FIX #7: Exported so other packages can declare variables of this type and access the struct fields directly.