[#73] Uploader, downloader structures refactoring #79

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-http-gw:feature/uploader_downloader_refactor into master 2023-09-08 08:05:13 +00:00
Member

Closes #73

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Closes #73 Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2023-08-31 11:15:14 +00:00
mbiryukova force-pushed feature/uploader_downloader_refactor from e87d7939e3 to cbd95ddbcf 2023-08-31 11:29:41 +00:00 Compare
mbiryukova force-pushed feature/uploader_downloader_refactor from cbd95ddbcf to a2a0ee8946 2023-08-31 11:54:37 +00:00 Compare
mbiryukova requested review from storage-services-committers 2023-08-31 12:04:22 +00:00
mbiryukova requested review from storage-services-developers 2023-08-31 12:04:24 +00:00
mbiryukova force-pushed feature/uploader_downloader_refactor from a2a0ee8946 to 665dce78b1 2023-08-31 12:44:27 +00:00 Compare
dkirillov reviewed 2023-09-01 12:55:32 +00:00
dkirillov left a comment
Member

Probable we can keep all handler's methods related to upload in handler/upload.go and methods for download in handler/download.go.

Everything else looks good

Probable we can keep all handler's methods related to upload in `handler/upload.go` and methods for download in `handler/download.go`. Everything else looks good
@ -0,0 +1,558 @@
package handler
Member

Probably we should move the handler package to internal directory.

The same for api package

Probably we should move the `handler` package to `internal` directory. The same for `api` package
Owner

Well, this is opinionated, but let's keep it. There is no wrong or right answer for this kind of layout.

Well, this is opinionated, but let's keep it. There is no wrong or right answer for this kind of layout.
@ -0,0 +67,4 @@
// Settings stores reloading parameters, so it has to provide atomic getters and setters.
type Settings struct {
defaultTimestamp atomic.Bool
zipCompression atomic.Bool
Member

I would use interface here instead of struct. But let's update it in #74

I would use interface here instead of struct. But let's update it in https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/issues/74
@ -0,0 +48,4 @@
return http.DetectContentType(buf), buf, err // to not lose io.EOF
}
func receiveFile(ctx context.Context, req request, clnt *pool.Pool, objectAddress oid.Address) {
Member

It seems we can use

func (h *Handler) receiveFile(ctx context.Context, req request, objectAddress oid.Address) {

the same for headObject.

The functions like Handler.byAttribute will have the following signature then

func (h *Handler) byAttribute(c *fasthttp.RequestCtx, f func(context.Context, request, oid.Address)) {
It seems we can use ```golang func (h *Handler) receiveFile(ctx context.Context, req request, objectAddress oid.Address) { ``` the same for `headObject`. The functions like `Handler.byAttribute` will have the following signature then ```golang func (h *Handler) byAttribute(c *fasthttp.RequestCtx, f func(context.Context, request, oid.Address)) { ```
mbiryukova force-pushed feature/uploader_downloader_refactor from 665dce78b1 to c111c84613 2023-09-01 14:00:50 +00:00 Compare
mbiryukova force-pushed feature/uploader_downloader_refactor from c111c84613 to d219943542 2023-09-06 08:05:27 +00:00 Compare
alexvanin approved these changes 2023-09-07 11:37:44 +00:00
pogpp approved these changes 2023-09-07 12:47:00 +00:00
ironbee approved these changes 2023-09-07 17:39:44 +00:00
r.loginov approved these changes 2023-09-08 07:59:30 +00:00
alexvanin merged commit d219943542 into master 2023-09-08 08:05:13 +00:00
alexvanin deleted branch feature/uploader_downloader_refactor 2023-09-08 08:05:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-http-gw#79
No description provided.