Skip to content

Commit

Permalink
Return only the URL
Browse files Browse the repository at this point in the history
  • Loading branch information
benderillo committed Jun 8, 2019
1 parent fed4b24 commit 4598f20
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cmd/s3url-presigner/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"encoding/json"
"fmt"
"os"
"time"
Expand Down Expand Up @@ -52,17 +51,12 @@ func main() {
urlStr := "s3://" + opts.Bucket + opts.Path
expiry := time.Second * time.Duration(opts.Expiry)

s3Url, expTime, err := s3.GetPresignedURL(opts.Method, urlStr, expiry)
s3Url, _, err := s3.GetPresignedURL(opts.Method, urlStr, expiry)

if err != nil {
log.Fatal().Err(err).Msg("Unable to generate presigned url")
}

output, _ := json.MarshalIndent(struct {
URL string
Expiry time.Time
}{URL: *s3Url, Expiry: expTime}, "", "\t")

fmt.Print(string(output))
fmt.Println(*s3Url)
os.Exit(0)
}

0 comments on commit 4598f20

Please sign in to comment.