/
authcurl.go
53 lines (42 loc) · 883 Bytes
/
authcurl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"github.com/totallymike/fetch/commands"
)
func main() {
commands.Execute()
/*
var AccessKey string
var SecretKey string
mainCommand := &cobra.Command{
Use: "main [url]",
Short: "Fetch requests from aws-authenticated endpoints",
Long: "Fetch data from the given url",
Run: func (cmd *cobra.Command, args []string) {
req, err := NewSignedRequest("GET")
resp, err := req.Perform("")
if err != nil {
log.Fatal(err)
}
robots, err := ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", robots)
},
}
mainCommand.PersistentFlags().StringVarP(
&AccessKey,
"access_key",
"",
"",
"your access key to the API")
mainCommand.PersistentFlags().StringVarP(
&SecretKey,
"secret_key",
"",
"",
"your secret key to the API")
mainCommand.Execute()
*/
}