Skip to content

Commit

Permalink
Add list objects api (#291)
Browse files Browse the repository at this point in the history
This includes the basic information of an object
  • Loading branch information
cesnietor committed Sep 29, 2020
1 parent 8313a62 commit 7afd608
Show file tree
Hide file tree
Showing 13 changed files with 1,176 additions and 7 deletions.
69 changes: 69 additions & 0 deletions models/bucket_object.go

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

100 changes: 100 additions & 0 deletions models/list_objects_response.go

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

6 changes: 6 additions & 0 deletions restapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type MinioClient interface {
removeBucket(ctx context.Context, bucketName string) error
getBucketNotification(ctx context.Context, bucketName string) (config notification.Configuration, err error)
getBucketPolicy(ctx context.Context, bucketName string) (string, error)
listObjects(ctx context.Context, bucket string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo
}

// Interface implementation
Expand Down Expand Up @@ -110,6 +111,11 @@ func (c minioClient) getBucketReplication(ctx context.Context, bucketName string
return c.client.GetBucketReplication(ctx, bucketName)
}

// implements minio.listObjects(ctx)
func (c minioClient) listObjects(ctx context.Context, bucket string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo {
return c.client.ListObjects(ctx, bucket, 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
2 changes: 2 additions & 0 deletions restapi/configure_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
registerNodesHandlers(api)
// Register Parity' handlers
registerParityHandlers(api)
// Register Object's Handlers
registerObjectsHandlers(api)

api.PreServerShutdown = func() {}

Expand Down
152 changes: 152 additions & 0 deletions restapi/embedded_spec.go

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

0 comments on commit 7afd608

Please sign in to comment.