Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

jonhadfield/gosn

Repository files navigation

gosn

Build Status CircleCI GoDoc Go Report Card

version 2 now available: 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

basic usage

authenticating

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

    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

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

creating a note

    # 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)