Skip to content

Commit 7afd608

Browse files
authored
Add list objects api (#291)
This includes the basic information of an object
1 parent 8313a62 commit 7afd608

13 files changed

+1176
-7
lines changed

models/bucket_object.go

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

models/list_objects_response.go

Lines changed: 100 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type MinioClient interface {
5353
removeBucket(ctx context.Context, bucketName string) error
5454
getBucketNotification(ctx context.Context, bucketName string) (config notification.Configuration, err error)
5555
getBucketPolicy(ctx context.Context, bucketName string) (string, error)
56+
listObjects(ctx context.Context, bucket string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo
5657
}
5758

5859
// Interface implementation
@@ -110,6 +111,11 @@ func (c minioClient) getBucketReplication(ctx context.Context, bucketName string
110111
return c.client.GetBucketReplication(ctx, bucketName)
111112
}
112113

114+
// implements minio.listObjects(ctx)
115+
func (c minioClient) listObjects(ctx context.Context, bucket string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo {
116+
return c.client.ListObjects(ctx, bucket, opts)
117+
}
118+
113119
// MCClient interface with all functions to be implemented
114120
// by mock when testing, it should include all mc/S3Client respective api calls
115121
// that are used within this project.

restapi/configure_console.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
118118
registerNodesHandlers(api)
119119
// Register Parity' handlers
120120
registerParityHandlers(api)
121+
// Register Object's Handlers
122+
registerObjectsHandlers(api)
121123

122124
api.PreServerShutdown = func() {}
123125

restapi/embedded_spec.go

Lines changed: 152 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)