Skip to content

Commit 44b9979

Browse files
authored
Add api to set object lock config on a bucket (#463)
1 parent 0749c87 commit 44b9979

13 files changed

+1017
-2
lines changed

models/object_retention_unit.go

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

models/put_bucket_retention_request.go

Lines changed: 121 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type MinioClient interface {
6868
getBucketEncryption(ctx context.Context, bucketName string) (*sse.Configuration, error)
6969
putObjectTagging(ctx context.Context, bucketName, objectName string, otags *tags.Tags, opts minio.PutObjectTaggingOptions) error
7070
getObjectTagging(ctx context.Context, bucketName, objectName string, opts minio.GetObjectTaggingOptions) (*tags.Tags, error)
71+
setObjectLockConfig(ctx context.Context, bucketName string, mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit) error
7172
}
7273

7374
// Interface implementation
@@ -169,6 +170,10 @@ func (c minioClient) getObjectTagging(ctx context.Context, bucketName, objectNam
169170
return c.client.GetObjectTagging(ctx, bucketName, objectName, opts)
170171
}
171172

173+
func (c minioClient) setObjectLockConfig(ctx context.Context, bucketName string, mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit) error {
174+
return c.client.SetObjectLockConfig(ctx, bucketName, mode, validity, unit)
175+
}
176+
172177
// MCClient interface with all functions to be implemented
173178
// by mock when testing, it should include all mc/S3Client respective api calls
174179
// that are used within this project.

restapi/embedded_spec.go

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

0 commit comments

Comments
 (0)