Esempio n. 1
0
// Create new AmazonSQS struct
func NewClient() *AmazonSQS {
	svc := &AmazonSQS{}
	svc.queues = make(map[string]*Queue)
	region := config.GetConfigValue(sqsConfigSectionName, "region", auth.EnvRegion())
	endpoint := config.GetConfigValue(sqsConfigSectionName, "endpoint", "")
	conf := auth.NewConfig(region, endpoint)
	conf.SetDefault(defaultRegion, defaultEndpoint)
	svc.client = SDK.New(conf.Config)
	return svc
}
Esempio n. 2
0
// Create new AmazonSQS struct
func NewClient() *AmazonSNS {
	svc := &AmazonSNS{}
	svc.apps = make(map[string]*SNSApp)
	svc.topics = make(map[string]*SNSTopic)
	region := config.GetConfigValue(snsConfigSectionName, "region", auth.EnvRegion())
	endpoint := config.GetConfigValue(snsConfigSectionName, "endpoint", "")
	conf := auth.NewConfig(region, endpoint)
	conf.SetDefault(defaultRegion, defaultEndpoint)
	svc.Client = SDK.New(conf.Config)
	if config.GetConfigValue(snsConfigSectionName, "app.production", "false") != "false" {
		isProduction = true
	} else {
		isProduction = false
	}
	return svc
}
Esempio n. 3
0
// Create new AmazonSQS struct
func NewClient() *AmazonSQS {
	svc := &AmazonSQS{}
	svc.queues = make(map[string]*Queue)
	region := config.GetConfigValue(sqsConfigSectionName, "region", auth.EnvRegion())
	awsConf := auth.NewConfig(region)
	endpoint := config.GetConfigValue(sqsConfigSectionName, "endpoint", "")
	switch {
	case endpoint != "":
		awsConf.Endpoint = endpoint
	case region == "":
		awsConf.Region = defaultRegion
		awsConf.Endpoint = defaultEndpoint
	}
	svc.client = SDK.New(awsConf)
	return svc
}
Esempio n. 4
0
// Create new AmazonSQS struct
func NewClient() *AmazonSNS {
	svc := &AmazonSNS{}
	svc.apps = make(map[string]*SNSApp)
	svc.topics = make(map[string]*SNSTopic)
	region := config.GetConfigValue(snsConfigSectionName, "region", auth.EnvRegion())
	awsConf := auth.NewConfig(region)
	endpoint := config.GetConfigValue(snsConfigSectionName, "endpoint", "")
	switch {
	case endpoint != "":
		awsConf.Endpoint = endpoint
	case region == "":
		awsConf.Region = defaultRegion
		awsConf.Endpoint = defaultEndpoint
	}
	svc.Client = SDK.New(awsConf)
	if config.GetConfigValue(snsConfigSectionName, "app.production", "false") != "false" {
		isProduction = true
	} else {
		isProduction = false
	}
	return svc
}