config

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func (c *Config) Read() error

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

func (c *Config) Save() error

Save persists config settings to disk. FIX #6: Returns an error when _v is nil instead of silently succeeding.

func (*Config) SetDynamoDBActionRetries

func (c *Config) SetDynamoDBActionRetries(i uint) error

func (*Config) SetDynamoDBAwsRegion

func (c *Config) SetDynamoDBAwsRegion(s string) error

func (*Config) SetDynamoDBDaxUrl

func (c *Config) SetDynamoDBDaxUrl(s string) error

func (*Config) SetDynamoDBTable

func (c *Config) SetDynamoDBTable(s string) error

func (*Config) SetDynamoDBTimeoutSeconds

func (c *Config) SetDynamoDBTimeoutSeconds(i uint) error

func (*Config) SetDynamoDBUseDax

func (c *Config) SetDynamoDBUseDax(b bool) error

func (*Config) SetGatewayKey

func (c *Config) SetGatewayKey(s string) error

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 (c *Config) SetHealthReportCleanUpFrequencySeconds(i uint) error

func (*Config) SetHealthReportRecordStaleMinutes added in v1.0.8

func (c *Config) SetHealthReportRecordStaleMinutes(i uint) error

func (*Config) SetServiceDiscoveryTimeoutSeconds added in v1.0.8

func (c *Config) SetServiceDiscoveryTimeoutSeconds(i uint) error

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.

Jump to

Keyboard shortcuts

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