Skip to content

Commit 24cc60f

Browse files
authored
Add put object api and add list object improvements (#356)
1 parent f967058 commit 24cc60f

13 files changed

+993
-147
lines changed

models/bucket_encryption_info_response.go

Lines changed: 0 additions & 129 deletions
This file was deleted.

models/bucket_object.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/put_object_tags_request.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

restapi/client.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"github.com/minio/minio-go/v7"
3939
"github.com/minio/minio-go/v7/pkg/credentials"
4040
"github.com/minio/minio-go/v7/pkg/notification"
41+
"github.com/minio/minio-go/v7/pkg/tags"
4142
)
4243

4344
func init() {
@@ -65,6 +66,8 @@ type MinioClient interface {
6566
setBucketEncryption(ctx context.Context, bucketName string, config *sse.Configuration) error
6667
removeBucketEncryption(ctx context.Context, bucketName string) error
6768
getBucketEncryption(ctx context.Context, bucketName string) (*sse.Configuration, error)
69+
putObjectTagging(ctx context.Context, bucketName, objectName string, otags *tags.Tags, opts minio.PutObjectTaggingOptions) error
70+
getObjectTagging(ctx context.Context, bucketName, objectName string, opts minio.GetObjectTaggingOptions) (*tags.Tags, error)
6871
}
6972

7073
// Interface implementation
@@ -75,7 +78,7 @@ type minioClient struct {
7578
client *minio.Client
7679
}
7780

78-
// implements minio.ListBucketsWithContext(ctx)
81+
// implements minio.ListBuckets(ctx)
7982
func (c minioClient) listBucketsWithContext(ctx context.Context) ([]minio.BucketInfo, error) {
8083
return c.client.ListBuckets(ctx)
8184
}
@@ -162,6 +165,14 @@ func (c minioClient) getBucketEncryption(ctx context.Context, bucketName string)
162165
return c.client.GetBucketEncryption(ctx, bucketName)
163166
}
164167

168+
func (c minioClient) putObjectTagging(ctx context.Context, bucketName, objectName string, otags *tags.Tags, opts minio.PutObjectTaggingOptions) error {
169+
return c.client.PutObjectTagging(ctx, bucketName, objectName, otags, opts)
170+
}
171+
172+
func (c minioClient) getObjectTagging(ctx context.Context, bucketName, objectName string, opts minio.GetObjectTaggingOptions) (*tags.Tags, error) {
173+
return c.client.GetObjectTagging(ctx, bucketName, objectName, opts)
174+
}
175+
165176
// MCClient interface with all functions to be implemented
166177
// by mock when testing, it should include all mc/S3Client respective api calls
167178
// that are used within this project.

0 commit comments

Comments
 (0)