Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang sdk on its way? #10

Closed
DallanQ opened this issue Aug 4, 2017 · 3 comments
Closed

Golang sdk on its way? #10

DallanQ opened this issue Aug 4, 2017 · 3 comments

Comments

@DallanQ
Copy link

DallanQ commented Aug 4, 2017

I noticed that recently (May) a PR to allow go support was merged. Does this mean an official go version of the SDK is on its way (I hope)?

I've found an unofficial one at https://github.com/dreampuf/evernote-sdk-golang but it only has a few stars, is on the 1.25 version of the API, and hasn't been committed to since April.

Any suggestions for me? If an official go version of the SDK is available, I'd love to beta-test it. Otherwise, would you recommend that I create my own golang sdk from the Thrift files, or would I be better off writing in a different language (like java)?

@iafan
Copy link
Contributor

iafan commented Aug 25, 2017

We use generated Go bindings internally at Evernote, but these are not officially blessed/supported for external use yet.

Note, however, that it should be rather straightforward to make your own bindings based on the provided Thrift files.

You can use the latest version of Thrift compiler, and the suggested way of compiling the Go code is to use the following helper script:

#/bin/sh

THRIFT_BINARY="./thrift"
PARAMS="-gen go:package_prefix=github.com/evernote/evernote-sdk-go/"
THRIFT_FILES_DIR="."

$THRIFT_BINARY $PARAMS $THRIFT_FILES_DIR/Errors.thrift
$THRIFT_BINARY $PARAMS $THRIFT_FILES_DIR/Limits.thrift
$THRIFT_BINARY $PARAMS $THRIFT_FILES_DIR/NoteStore.thrift
$THRIFT_BINARY $PARAMS $THRIFT_FILES_DIR/Types.thrift
$THRIFT_BINARY $PARAMS $THRIFT_FILES_DIR/UserStore.thrift

The generated .go files need to be tweaked manually in a few places (explicit casting of types required); this might change with Go 1.9 which has type aliases).

Then you can manually put the generated .go files under $GOPATH/src/github.com/evernote/evernote-sdk-go/edam and start using them.

@DallanQ
Copy link
Author

DallanQ commented Aug 25, 2017

thank you!

@DallanQ DallanQ closed this as completed Aug 25, 2017
@vitaly-zdanevich
Copy link

Will we get official Go SDK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants