gkeepapi

package module
v0.0.0-...-585151e Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 8 Imported by: 0

README

Inspired by gkeepapi Python library.

This is a stub of the (mobile) Google Keep API client package, so it has limited functionality and is under construction. For now, you can use it to view all of your Google Keep notes as follows:

package main

import (
	"fmt"
	"log"

	"github.com/kjedeligmann/gkeepapi"
)

var email, masterToken, gaid string // your credentials

func main() {
	var keep gkeepapi.Keep
	keep.Authenticate(email, gaid, masterToken)
	notes, err := keep.List()
	if err != nil {
		log.Fatal(err)
	}
	for _, note := range notes {
		fmt.Printf("%s\n%s\n\n", note.Title, note.Text)
	}
}

You can get masterToken using gpsoauth package.

Documentation

Index

Constants

View Source
const APIURL = "https://www.googleapis.com/notes/v1/"
View Source
const OAuthScopes string = "oauth2:https://www.googleapis.com/auth/memento https://www.googleapis.com/auth/reminders"

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func (*Auth) Load

func (s *Auth) Load(email, gaid, masterToken string) error

func (*Auth) Refresh

func (s *Auth) Refresh() error

type Keep

type Keep struct {
	Auth
	// contains filtered or unexported fields
}

func (*Keep) Authenticate

func (s *Keep) Authenticate(email, gaid, masterToken string) error

func (*Keep) List

func (s *Keep) List() (map[string]Note, error)

List all notes.

type Node

type Node struct {
	Type       string
	Id         string
	ParentId   string
	Timestamps Timestamps
	Title      string
	Text       string
}

type Note

type Note struct {
	Created string
	Title   string
	Text    string
}

type ResponseBody

type ResponseBody struct {
	Nodes []Node
}

type Timestamps

type Timestamps struct {
	Created string
}

Jump to

Keyboard shortcuts

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