Skip to content

TcM1911/evernote-sdk-golang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evernote SDK Golang

This project was simple code generated from Evernote-thrift-1.25 .

Simple

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")
}

How to generate yourself code

  1. Install the newest Thrift. It's a type alias bug of golang generator THRIFT-2955.

  2. Clone the official evernote-thrift repo https://github.com/evernote/evernote-thrift

  3. 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

  4. Rename the problem offical example from the generation:

    mv notestore/note_store-remote/note_store-remote.go{,.out_of_time_official_example}

  5. Enjoy!

About

Evernote SDK golang port

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%