This project was simple code generated from Evernote-thrift-1.25 .
go get -u github.com/dreampuf/evernote-sdk-golang/...
See client_test.go
c := NewClient(EvernoteKey, EvernoteSecret, SANDBOX)
us, err := c.GetUserStore()
if err != nil {
t.Fatal(err)
}
url, err := us.GetNoteStoreUrl(EvernoteAuthorToken)
if err != nil {
t.Fatal(err)
}
if len(url) < 1 {
t.Fatal("Invalid URL")
}
ns, err := c.GetNoteStoreWithURL(url)
if err != nil {
t.Fatal(err)
}
note, err := ns.GetDefaultNotebook(EvernoteAuthorToken)
if err != nil {
t.Fatal(err)
}
if note == nil {
t.Fatal("Invalid Note")
}
-
Install the newest Thrift. It's a type alias bug of golang generator THRIFT-2955.
-
Clone the official evernote-thrift repo
https://github.com/evernote/evernote-thrift
-
Generator with this command:
thrift -strict -nowarn --allow-64bit-consts --allow-neg-keys --gen go:package_prefix=github.com/dreampuf/evernote-sdk-golang/ evernote-thrift/src/UserStore.thrift
-
Rename the problem offical example from the generation:
mv notestore/note_store-remote/note_store-remote.go{,.out_of_time_official_example}
-
Enjoy!