Documentation ¶
Index ¶
- Variables
- func AddUseRawContentToContext(ctx context.Context, val bool) context.Context
- func GetUseRawContentFromContext(ctx context.Context) bool
- func Login(client APIClient) error
- func Logout(cfg clinote.Configuration) error
- type APIClient
- type Client
- func (c *Client) Close() error
- func (c Client) GetAPIToken() string
- func (c *Client) GetAuthorizedToken(tmpToken *oauth.RequestToken, verifier string) (string, error)
- func (c *Client) GetConfig() clinote.Configuration
- func (c *Client) GetNoteStore() (clinote.NotestoreClient, error)
- func (c *Client) GetRequestToken(callback string) (*oauth.RequestToken, string, error)
- type Notestore
- func (s *Notestore) CreateNote(n *clinote.Note) error
- func (s *Notestore) CreateNotebook(b *clinote.Notebook, defaultNotebook bool) error
- func (s *Notestore) DeleteNote(guid string) error
- func (s *Notestore) FindNotes(filter *clinote.NoteFilter, offset, count int) ([]*clinote.Note, error)
- func (s *Notestore) GetAllNotebooks() ([]*clinote.Notebook, error)
- func (s *Notestore) GetNoteContent(guid string) (string, error)
- func (s *Notestore) GetNotebook(guid string) (*clinote.Notebook, error)
- func (s *Notestore) UpdateNote(note *clinote.Note) error
- func (s *Notestore) UpdateNotebook(b *clinote.Notebook) error
Constants ¶
This section is empty.
Variables ¶
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") )
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
AddUseRawContentToContext adds the value to the context.
func GetUseRawContentFromContext ¶ added in v0.3.0
GetUseRawContentFromContext get's the useRawContent from the context.
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) GetAPIToken ¶ added in v0.3.0
GetAPIToken is the access token for the user's account.
func (*Client) GetAuthorizedToken ¶ added in v0.3.0
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
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
CreateNote creates a new note and saves it to the server.
func (*Notestore) CreateNotebook ¶ added in v0.3.0
CreateNotebook creates a new notebook for the user.
func (*Notestore) DeleteNote ¶ added in v0.3.0
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
GetAllNotebooks returns all the of users notebooks.
func (*Notestore) GetNoteContent ¶ added in v0.3.0
GetNoteContent gets the note's content from the notestore.
func (*Notestore) GetNotebook ¶ added in v0.3.0
GetNotebook returns the notebook with the specific GUID.
func (*Notestore) UpdateNote ¶ added in v0.3.0
UpdateNote update's the note.