Beispiel #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
}
Beispiel #2
0
// Create new AmazonS3 struct
func NewClient() *AmazonS3 {
	s := &AmazonS3{}
	s.buckets = make(map[string]*Bucket)
	region := config.GetConfigValue(s3ConfigSectionName, "region", "")
	endpoint := config.GetConfigValue(s3ConfigSectionName, "endpoint", "")
	conf := auth.NewConfig(region, endpoint)
	conf.SetDefault(defaultRegion, defaultEndpoint)
	if conf.Config.Endpoint != "" {
		conf.Config.S3ForcePathStyle = true
	}
	s.client = SDK.New(conf.Config)
	return s
}
Beispiel #3
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
}
Beispiel #4
0
// Create new AmazonDynamoDB struct
func NewClient() *AmazonDynamoDB {
	region := config.GetConfigValue(dynamodbConfigSectionName, "region", "")
	endpoint := config.GetConfigValue(dynamodbConfigSectionName, "endpoint", "")
	conf := auth.NewConfig(region, endpoint)
	return newClient(conf)
}