evernote

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotLoggedIn is returned when the user is trying to perform
	// authenticated actions without being authenticated.
	ErrNotLoggedIn = errors.New("your are not logged in")
	// ErrAlreadyLoggedIn is returned if the user is trying to authenticate
	// but is already authenticated.
	ErrAlreadyLoggedIn = errors.New("you are already logged in")
	// ErrTempTokenMismatch is returned if the callback doesn't match the
	// expected token.
	ErrTempTokenMismatch = errors.New("temporary token mismatch")
	// ErrAccessRevoked is returned if the user decline access.
	ErrAccessRevoked = errors.New("access revoked")
	// ErrNoGUIDSet is returned if the note does not have a GUID.
	ErrNoGUIDSet = errors.New("no GUID set.")
	// ErrNoTitleSet is returned if the not does not have a title.
	ErrNoTitleSet = errors.New("no title set")
)
View Source
var ErrNoCachedNote = errors.New("no cache note found")

ErrNoCachedNote is return if the note wasn't cached and can't be updated.

Functions

func AddUseRawContentToContext added in v0.3.0

func AddUseRawContentToContext(ctx context.Context, val bool) context.Context

AddUseRawContentToContext adds the value to the context.

func GetUseRawContentFromContext added in v0.3.0

func GetUseRawContentFromContext(ctx context.Context) bool

GetUseRawContentFromContext get's the useRawContent from the context.

func Login added in v0.3.0

func Login(client APIClient) error

Login logs the user in to the server.

func Logout added in v0.3.0

func Logout(cfg clinote.Configuration) error

Logout removes the session stored.

Types

type APIClient added in v0.3.0

type APIClient interface {
	// GetNoteStore returns the note store for the user.
	GetNoteStore() (clinote.NotestoreClient, error)
	// GetAuthorizedToken gets the authorized token from the server.
	GetAuthorizedToken(tmpToken *oauth.RequestToken, verifier string) (token string, err error)
	// GetRequestToken requests a request token from the server.
	GetRequestToken(callbackURL string) (token *oauth.RequestToken, url string, err error)
	// GetConfig returns the client's configuration.
	GetConfig() clinote.Configuration
}

APIClient is the interface for the api client.

type Client added in v0.3.0

type Client struct {
	// Config holds all the configurations.
	Config clinote.Configuration
	// contains filtered or unexported fields
}

Client is an implementation of the client interface for Evernote.

func NewClient added in v0.3.0

func NewClient(cfg clinote.Configuration) *Client

NewClient creates a new Evernote client.

func (*Client) Close added in v0.4.0

func (c *Client) Close() error

Close shuts down the client.

func (Client) GetAPIToken added in v0.3.0

func (c Client) GetAPIToken() string

GetAPIToken is the access token for the user's account.

func (*Client) GetAuthorizedToken added in v0.3.0

func (c *Client) GetAuthorizedToken(tmpToken *oauth.RequestToken, verifier string) (string, error)

GetAuthorizedToken gets the authorized token from the server.

func (*Client) GetConfig added in v0.3.0

func (c *Client) GetConfig() clinote.Configuration

GetConfig returns the configuration.

func (*Client) GetNoteStore added in v0.3.0

func (c *Client) GetNoteStore() (clinote.NotestoreClient, error)

GetNoteStore returns a notestore client for the user.

func (*Client) GetRequestToken added in v0.3.0

func (c *Client) GetRequestToken(callback string) (*oauth.RequestToken, string, error)

GetRequestToken requests a request token from the server.

type Notestore added in v0.3.0

type Notestore struct {
	// contains filtered or unexported fields
}

Notestore is an implementation of the NotestoreClient.

func (*Notestore) CreateNote added in v0.3.0

func (s *Notestore) CreateNote(n *clinote.Note) error

CreateNote creates a new note and saves it to the server.

func (*Notestore) CreateNotebook added in v0.3.0

func (s *Notestore) CreateNotebook(b *clinote.Notebook, defaultNotebook bool) error

CreateNotebook creates a new notebook for the user.

func (*Notestore) DeleteNote added in v0.3.0

func (s *Notestore) DeleteNote(guid string) error

DeleteNote removes a note from the user's notebook.

func (*Notestore) FindNotes added in v0.3.0

func (s *Notestore) FindNotes(filter *clinote.NoteFilter, offset, count int) ([]*clinote.Note, error)

FindNotes searches for the notes based on the filter.

func (*Notestore) GetAllNotebooks added in v0.3.0

func (s *Notestore) GetAllNotebooks() ([]*clinote.Notebook, error)

GetAllNotebooks returns all the of users notebooks.

func (*Notestore) GetNoteContent added in v0.3.0

func (s *Notestore) GetNoteContent(guid string) (string, error)

GetNoteContent gets the note's content from the notestore.

func (*Notestore) GetNotebook added in v0.3.0

func (s *Notestore) GetNotebook(guid string) (*clinote.Notebook, error)

GetNotebook returns the notebook with the specific GUID.

func (*Notestore) UpdateNote added in v0.3.0

func (s *Notestore) UpdateNote(note *clinote.Note) error

UpdateNote update's the note.

func (*Notestore) UpdateNotebook added in v0.3.0

func (s *Notestore) UpdateNotebook(b *clinote.Notebook) error

UpdateNotebook updates the notebook on the server.

Directories

Path Synopsis
Package api provides interface for the Evernote API.
Package api provides interface for the Evernote API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL