Skip to content

Commit 5fd5606

Browse files
committed
misc: refactoring way to pass config to the dropbox client
1 parent 03c2c25 commit 5fd5606

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

examples/dropbox/dropbox.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"encoding/json"
56
"fmt"
67
"github.com/Matrix86/cloudwatcher"
78
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
@@ -10,9 +11,9 @@ import (
1011
)
1112

1213
const (
13-
ClientId = "ZZZZZZ"
14-
ClientSecret = "YYYYYY"
15-
Token = "XXXXXX"
14+
ClientId = ""
15+
ClientSecret = ""
16+
Token = ""
1617
)
1718

1819
func getAuthCode() (string, error) {
@@ -37,7 +38,12 @@ func getAuthCode() (string, error) {
3738
if err != nil {
3839
return "", err
3940
}
40-
return token.AccessToken, nil
41+
42+
b, err := json.Marshal(token)
43+
if err != nil {
44+
return "", err
45+
}
46+
return string(b), nil
4147
}
4248
func main() {
4349
s, err := cloudwatcher.New("dropbox", "", 2*time.Second)

0 commit comments

Comments
 (0)