Skip to content

Commit

Permalink
Remove sqs and dynamodb
Browse files Browse the repository at this point in the history
  • Loading branch information
minhduc140583 committed Sep 23, 2023
1 parent e1a7bef commit f560d4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 132 deletions.
71 changes: 0 additions & 71 deletions dynamodb/health_checker.go

This file was deleted.

9 changes: 5 additions & 4 deletions firestore/health_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package firestore
import (
"cloud.google.com/go/firestore"
"context"
"errors"
"google.golang.org/api/option"
"google.golang.org/api/transport"
)
Expand All @@ -21,7 +22,7 @@ func NewFirestoreHealthChecker(name string, projectId string, opts ...option.Cli
func NewHealthCheckerWithProjectId(projectId string, opts ...option.ClientOption) *HealthChecker {
return NewFirestoreHealthChecker("firestore", projectId, opts...)
}
func NewHealthChecker(ctx context.Context, credentials []byte, options ...string) *HealthChecker {
func NewHealthChecker(ctx context.Context, credentials []byte, projectId string, options ...string) (*HealthChecker, error) {
var name string
if len(options) > 0 && len(options[0]) > 0 {
name = options[0]
Expand All @@ -31,12 +32,12 @@ func NewHealthChecker(ctx context.Context, credentials []byte, options ...string
opts := option.WithCredentialsJSON(credentials)
creds, er2 := transport.Creds(ctx, opts)
if er2 != nil {
panic("Credentials Error: " + er2.Error())
return nil, er2
}
if creds == nil {
panic("Error: creds is nil")
return nil, errors.New("error: credentials is nil")
}
return NewFirestoreHealthChecker(name, creds.ProjectID, opts)
return NewFirestoreHealthChecker(name, projectId, opts), nil
}
func (s HealthChecker) Name() string {
return s.name
Expand Down
57 changes: 0 additions & 57 deletions sqs/health_checker.go

This file was deleted.

0 comments on commit f560d4f

Please sign in to comment.