Skip to content

Commit

Permalink
[ALL] Add private accessors: 'GetClient', 'SetPrefix' etc (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
evalphobia authored Oct 7, 2021
1 parent 1a77a90 commit 0ad241a
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cloudtrail/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func NewFromSession(sess *session.Session) *CloudTrail {
}
}

// GetClient gets aws client.
func (svc *CloudTrail) GetClient() *SDK.CloudTrail {
return svc.client
}

// SetLogger sets logger.
func (svc *CloudTrail) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
5 changes: 5 additions & 0 deletions cloudwatch/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func NewFromSession(sess *session.Session) *CloudWatch {
}
}

// GetClient gets aws client.
func (svc *CloudWatch) GetClient() *SDK.CloudWatch {
return svc.client
}

// SetLogger sets logger.
func (svc *CloudWatch) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
5 changes: 5 additions & 0 deletions costexplorer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func NewFromSession(sess *session.Session) *CostExplorer {
}
}

// GetClient gets aws client.
func (svc *CostExplorer) GetClient() *SDK.CostExplorer {
return svc.client
}

// SetLogger sets logger.
func (svc *CostExplorer) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
7 changes: 6 additions & 1 deletion dynamodb/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewFromSession(sess *session.Session) *DynamoDB {
}
}

// GetClient get client.
// GetClient gets aws client.
func (svc *DynamoDB) GetClient() *SDK.DynamoDB {
return svc.client
}
Expand All @@ -61,6 +61,11 @@ func (svc *DynamoDB) SetLogger(logger log.Logger) {
svc.logger = logger
}

// SetPrefix sets prefix.
func (svc *DynamoDB) SetPrefix(prefix string) {
svc.prefix = prefix
}

// ===================
// Table Operation
// ===================
Expand Down
5 changes: 5 additions & 0 deletions iam/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func NewFromSession(sess *session.Session) *IAM {
}
}

// GetClient gets aws client.
func (svc *IAM) GetClient() *SDK.IAM {
return svc.client
}

// SetLogger sets logger.
func (svc *IAM) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
10 changes: 10 additions & 0 deletions kinesis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,21 @@ func NewFromSession(sess *session.Session) *Kinesis {
}
}

// GetClient gets aws client.
func (svc *Kinesis) GetClient() *SDK.Kinesis {
return svc.client
}

// SetLogger sets logger.
func (svc *Kinesis) SetLogger(logger log.Logger) {
svc.logger = logger
}

// SetPrefix sets prefix.
func (svc *Kinesis) SetPrefix(prefix string) {
svc.prefix = prefix
}

// GetStream gets Kinesis Stream.
func (svc *Kinesis) GetStream(name string) (*Stream, error) {
streamName := svc.prefix + name
Expand Down
5 changes: 5 additions & 0 deletions kms/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ func NewFromSession(sess *session.Session) *KMS {
}
}

// GetClient gets aws client.
func (svc *KMS) GetClient() *SDK.KMS {
return svc.client
}

// SetLogger sets logger.
func (svc *KMS) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
5 changes: 5 additions & 0 deletions pinpointemail/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func NewFromSession(sess *session.Session) *PinpointEmail {
}
}

// GetClient gets aws client.
func (svc *PinpointEmail) GetClient() *SDK.PinpointEmail {
return svc.client
}

// SetLogger sets logger.
func (svc *PinpointEmail) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
10 changes: 10 additions & 0 deletions rekognition/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,21 @@ func NewFromSession(sess *session.Session) *Rekognition {
}
}

// GetClient gets aws client.
func (svc *Rekognition) GetClient() *SDK.Rekognition {
return svc.client
}

// SetLogger sets logger.
func (svc *Rekognition) SetLogger(logger log.Logger) {
svc.logger = logger
}

// SetPrefix sets prefix.
func (svc *Rekognition) SetPrefix(prefix string) {
svc.prefix = prefix
}

// SetHTTPClient sets httpClient.
func (svc *Rekognition) SetHTTPClient(httpClient HTTPClient) {
svc.httpClient = httpClient
Expand Down
15 changes: 15 additions & 0 deletions s3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,26 @@ func NewFromSession(sess *session.Session) *S3 {
}
}

// GetClient gets aws client.
func (svc *S3) GetClient() *SDK.S3 {
return svc.client
}

// SetLogger sets logger.
func (svc *S3) SetLogger(logger log.Logger) {
svc.logger = logger
}

// SetPrefix sets prefix.
func (svc *S3) SetPrefix(prefix string) {
svc.prefix = prefix
}

// SetEndpoint sets endpoint.
func (svc *S3) SetEndpoint(endpoint string) {
svc.endpoint = endpoint
}

// GetBucket gets S3 bucket.
func (svc *S3) GetBucket(bucket string) (*Bucket, error) {
bucketName := svc.prefix + bucket
Expand Down
10 changes: 10 additions & 0 deletions sns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,21 @@ func NewFromSession(sess *session.Session) *SNS {
}
}

// GetClient gets aws client.
func (svc *SNS) GetClient() *SDK.SNS {
return svc.client
}

// SetLogger sets logger.
func (svc *SNS) SetLogger(logger log.Logger) {
svc.logger = logger
}

// SetPrefix sets prefix.
func (svc *SNS) SetPrefix(prefix string) {
svc.prefix = prefix
}

// SetPlatforms sets platforms.
func (svc *SNS) SetPlatforms(pf Platforms) {
svc.platforms = pf
Expand Down
5 changes: 5 additions & 0 deletions sqs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func NewFromSession(sess *session.Session) *SQS {
}
}

// GetClient gets aws client.
func (svc *SQS) GetClient() *SDK.SQS {
return svc.client
}

// SetLogger sets logger.
func (svc *SQS) SetLogger(logger log.Logger) {
svc.logger = logger
Expand Down
10 changes: 10 additions & 0 deletions xray/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,21 @@ func NewFromSession(sess *session.Session) *XRay {
}
}

// GetClient gets aws client.
func (svc *XRay) GetClient() *SDK.XRay {
return svc.client
}

// SetLogger sets logger.
func (svc *XRay) SetLogger(logger log.Logger) {
svc.logger = logger
}

// SetPrefix sets prefix.
func (svc *XRay) SetPrefix(prefix string) {
svc.prefix = prefix
}

// SetSamplingPolicy sets sampling policy.
func (svc *XRay) SetSamplingPolicy(fraction, qps float64) error {
s, err := NewLimitedSampler(fraction, qps)
Expand Down

0 comments on commit 0ad241a

Please sign in to comment.