From 224103a4f4cead6b624c08520f096f38a03f7ffa Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Mon, 24 Apr 2023 16:38:49 +0200 Subject: [PATCH] action is null for standalone transfer agents. --- api/protocol.go | 9 --------- service/service.go | 8 ++++---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/api/protocol.go b/api/protocol.go index e92068f..a7ef925 100644 --- a/api/protocol.go +++ b/api/protocol.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "io" - "time" ) // Header struct @@ -13,13 +12,6 @@ type Header struct { Value string `json:"value"` } -// Action struct -type Action struct { - Href string `json:"href"` - Header map[string]string `json:"header,omitempty"` - ExpiresAt time.Time `json:"expires_at,omitempty"` -} - // Error struct type Message struct { Event string `json:"event"` @@ -44,7 +36,6 @@ type Request struct { Oid string `json:"oid"` Size int64 `json:"size"` Path string `json:"path"` - Action *Action `json:"action"` } // InitResponse with response for init diff --git a/service/service.go b/service/service.go index e5bbda3..1924f7b 100644 --- a/service/service.go +++ b/service/service.go @@ -70,10 +70,10 @@ func Serve(stdin io.Reader, stdout, stderr io.Writer) { api.SendResponse(resp, writer, stderr) case "download": fmt.Fprintf(stderr, fmt.Sprintf("Received download request for %s\n", req.Oid)) - retrieve(req.Oid, req.Size, req.Action, writer, stderr) + retrieve(req.Oid, req.Size, writer, stderr) case "upload": fmt.Fprintf(stderr, fmt.Sprintf("Received upload request for %s\n", req.Oid)) - store(req.Oid, req.Size, req.Action, writer, stderr) + store(req.Oid, req.Size, writer, stderr) case "terminate": fmt.Fprintf(stderr, "Terminating test custom adapter gracefully.\n") break @@ -103,7 +103,7 @@ func createS3Client() *s3.Client { return s3.NewFromConfig(cfg) } -func retrieve(oid string, size int64, action *api.Action, writer io.Writer, stderr io.Writer) { +func retrieve(oid string, size int64, writer io.Writer, stderr io.Writer) { client := createS3Client() bucketName := os.Getenv("S3_BUCKET") @@ -149,7 +149,7 @@ func retrieve(oid string, size int64, action *api.Action, writer io.Writer, stde } } -func store(oid string, size int64, action *api.Action, writer io.Writer, stderr io.Writer) { +func store(oid string, size int64, writer io.Writer, stderr io.Writer) { client := createS3Client() bucketName := os.Getenv("S3_BUCKET")