Documentation
¶
Index ¶
- type Config
- func (c *Config) GetAllSubscriptionArns() []SubscriptionsData
- func (c *Config) GetSubscriptionArn(topicArn string) string
- func (c *Config) Read() error
- func (c *Config) RemoveSubscriptionData(topicArn string)
- 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) SetNotifierGatewayUrl(s string) error
- func (c *Config) SetServerKey(s string) error
- func (c *Config) SetSnsAwsRegion(s string) error
- func (c *Config) SetSubscriptionData(topicArn string, subscriptionArn string)
- type NotifierServerData
- type SubscriptionsData
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:"-"`
// FIX #1: Exported types so other packages can declare variables of these types
NotifierServerData *NotifierServerData `mapstructure:"notifier_server"`
SubscriptionsData []*SubscriptionsData `mapstructure:"subscriptions"`
// contains filtered or unexported fields
}
func (*Config) GetAllSubscriptionArns ¶ added in v1.7.5
func (c *Config) GetAllSubscriptionArns() []SubscriptionsData
FIX #3: GetSubscriptionArn — added nil receiver check and nil element check to prevent panic on bare Config{} or if SubscriptionsData contains nil entries. GetAllSubscriptionArns returns a snapshot of all subscription data under the lock.
func (*Config) GetSubscriptionArn ¶
func (*Config) Read ¶
Read will load config settings from disk. FIX #7: Builds into local variables first and only overwrites c._v, c.NotifierServerData, and c.SubscriptionsData on success, so a failed Read() doesn't destroy previously valid state.
func (*Config) RemoveSubscriptionData ¶
RemoveSubscriptionData removes subscription data from config. hint: topicArn = blank to remove all subscription data from config. FIX #5: Added nil receiver check, nil element check in loop, and uses strings.EqualFold for consistency.
func (*Config) Save ¶
Save persists config settings to disk. FIX #8: 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) SetNotifierGatewayUrl ¶
func (*Config) SetServerKey ¶
func (*Config) SetSnsAwsRegion ¶
func (*Config) SetSubscriptionData ¶
FIX #4: SetSubscriptionData — added nil receiver check, nil element check in loop, and ensureServerData guard. Uses strings.EqualFold for consistency.
type NotifierServerData ¶ added in v1.7.1
type NotifierServerData struct {
GatewayUrl string `mapstructure:"gateway_url"`
ServerKey string `mapstructure:"server_key"`
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"`
SnsAwsRegion string `mapstructure:"sns_aws_region"`
}
FIX #1: Exported so other packages can reference this type directly
type SubscriptionsData ¶ added in v1.7.1
type SubscriptionsData struct {
TopicArn string `mapstructure:"topic_arn"`
SubscriptionArn string `mapstructure:"subscription_arn"`
}
FIX #1: Exported so other packages can reference this type directly