diff --git a/cmd/server.go b/cmd/server.go index a1856c9..f7e323c 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -148,13 +148,12 @@ func handleV1Health(c echo.Context) error { message := make(map[string]interface{}, len(documents_buckets)) - for _, bucket := range documents_buckets { - - exists, err := client.BucketExists(bucket) + for _, bucket_name := range documents_buckets { + exists, err := client.BucketExists(bucket_name) if err != nil { return c.JSON(http.StatusInternalServerError, err) } - message[bucket] = exists + message[bucket_name] = exists } return c.JSON(http.StatusOK, message) diff --git a/data/data.go b/data/data.go index 8d29b9a..4c6fd2e 100644 --- a/data/data.go +++ b/data/data.go @@ -11,7 +11,7 @@ import ( type Client struct { Endpoint, AccessKeyID, SecretAccessKey string UseSSL bool - MongoClient *minio.Client + MinioClient *minio.Client Context context.Context } @@ -25,7 +25,7 @@ func NewClient(buckets []string, endpoint, accessKeyID, secretAccessKey string, } // Initialize minio client object - mongo_client, err := minio.New(endpoint, &minio.Options{ + minio_client, err := minio.New(endpoint, &minio.Options{ Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""), Secure: useSSL, }) @@ -33,13 +33,13 @@ func NewClient(buckets []string, endpoint, accessKeyID, secretAccessKey string, return &c, err } - c.MongoClient = mongo_client + c.MinioClient = minio_client return &c, nil } func (c *Client) BucketExists(bucketName string) (bool, error) { - result, err := c.MongoClient.BucketExists(c.Context, bucketName) + result, err := c.MinioClient.BucketExists(c.Context, bucketName) if err != nil { return false, err }