Skip to content

Commit

Permalink
Add put object api and add list object improvements (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesnietor committed Oct 28, 2020
1 parent f967058 commit 24cc60f
Show file tree
Hide file tree
Showing 13 changed files with 993 additions and 147 deletions.
129 changes: 0 additions & 129 deletions models/bucket_encryption_info_response.go

This file was deleted.

3 changes: 3 additions & 0 deletions models/bucket_object.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions models/put_object_tags_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion restapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/minio/minio-go/v7/pkg/notification"
"github.com/minio/minio-go/v7/pkg/tags"
)

func init() {
Expand Down Expand Up @@ -65,6 +66,8 @@ type MinioClient interface {
setBucketEncryption(ctx context.Context, bucketName string, config *sse.Configuration) error
removeBucketEncryption(ctx context.Context, bucketName string) error
getBucketEncryption(ctx context.Context, bucketName string) (*sse.Configuration, error)
putObjectTagging(ctx context.Context, bucketName, objectName string, otags *tags.Tags, opts minio.PutObjectTaggingOptions) error
getObjectTagging(ctx context.Context, bucketName, objectName string, opts minio.GetObjectTaggingOptions) (*tags.Tags, error)
}

// Interface implementation
Expand All @@ -75,7 +78,7 @@ type minioClient struct {
client *minio.Client
}

// implements minio.ListBucketsWithContext(ctx)
// implements minio.ListBuckets(ctx)
func (c minioClient) listBucketsWithContext(ctx context.Context) ([]minio.BucketInfo, error) {
return c.client.ListBuckets(ctx)
}
Expand Down Expand Up @@ -162,6 +165,14 @@ func (c minioClient) getBucketEncryption(ctx context.Context, bucketName string)
return c.client.GetBucketEncryption(ctx, bucketName)
}

func (c minioClient) putObjectTagging(ctx context.Context, bucketName, objectName string, otags *tags.Tags, opts minio.PutObjectTaggingOptions) error {
return c.client.PutObjectTagging(ctx, bucketName, objectName, otags, opts)
}

func (c minioClient) getObjectTagging(ctx context.Context, bucketName, objectName string, opts minio.GetObjectTaggingOptions) (*tags.Tags, error) {
return c.client.GetObjectTagging(ctx, bucketName, objectName, opts)
}

// MCClient interface with all functions to be implemented
// by mock when testing, it should include all mc/S3Client respective api calls
// that are used within this project.
Expand Down

0 comments on commit 24cc60f

Please sign in to comment.