An open API service indexing awesome lists of open source software.

https://github.com/jonhadfield/gosn

A go library for Standard Notes
https://github.com/jonhadfield/gosn

golang golang-library standard-notes

Last synced: 5 months ago
JSON representation

A go library for Standard Notes

Awesome Lists containing this project

README

          

# gosn
[![Build Status](https://www.travis-ci.org/jonhadfield/gosn.svg?branch=master)](https://www.travis-ci.org/jonhadfield/gosn) [![CircleCI](https://circleci.com/gh/jonhadfield/gosn/tree/master.svg?style=svg)](https://circleci.com/gh/jonhadfield/gosn/tree/master) [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/jonhadfield/gosn/) [![Go Report Card](https://goreportcard.com/badge/github.com/jonhadfield/gosn)](https://goreportcard.com/report/github.com/jonhadfield/gosn)

### version 2 now available: [gosn-v2](https://github.com/jonhadfield/gosn-v2)

# about

Standard Notes is a service and application for the secure management and storage of notes.

gosn is a library to help develop your own application to manage notes on the official, or your self-hosted, Standard Notes server.

# installation

Using go get: ``` go get github.com/jonhadfield/gosn```

# documentation

- [guides](docs/index.md)
- [go docs](https://godoc.org/github.com/jonhadfield/gosn)

# basic usage
## authenticating

To interact with Standard Notes you first need to sign in:

```golang
sIn := gosn.SignInInput{
Email: "someone@example.com",
Password: "mysecret,
}
sOut, _ := gosn.SignIn(sIn)
```

This will return a session containing the necessary secrets and information to make requests to get or put data.

## getting items

```golang
input := GetItemsInput{
Session: sOut.Session,
}
gio, _ := GetItems(input)
```

## creating a note

```golang
# create note content
content := NoteContent{
Title: "Note Title",
Text: "Note Text",
}
# create note
note := NewNote()
note.Content = content

# sync note
pii := PutItemsInput{
Session: sOut.Session,
Items: []gosn.Notes{note},
}
pio, _ := PutItems(pii)
```