Categorygithub.com/jonhadfield/gosn
modulepackage
0.0.2
Repository: https://github.com/jonhadfield/gosn.git
Documentation: pkg.go.dev

# README

gosn

Build Status CircleCI GoDoc Go Report Card

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:     "[email protected]",
        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)

# Functions

No description provided by the author
CLiSignIn takes the server URL and credentials and sends them to the API to get a response including an authentication token plus the keys required to encrypt and decrypt SN items.
decrypt from base64 to decrypted string.
encrypt string to base64 crypto using AES.
GenUUID generates a unique identifier required when creating a new item.
No description provided by the author
GetItems retrieves items from the API using optional filters.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewComponent returns an Item of type Component without content.
NewTagContent returns an empty Tag content instance.
NewNote returns an Item of type Note without content.
NewNoteContent returns an empty Note content instance.
NewTag returns an Item of type Tag without content.
NewTagContent returns an empty Tag content instance.
No description provided by the author
PutItems validates and then syncs items via API.
RemoveSession removes the SN session from the keyring.
No description provided by the author
No description provided by the author
SignIn authenticates with the server using credentials and optional MFA in order to obtain the data required to interact with Standard Notes.
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PageSize is the maximum number of items to return with each call.
No description provided by the author

# Structs

No description provided by the author
AppTagConfig defines expected configuration structure for making Tag related operations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetItemsInput defines the input for retrieving items.
GetItemsOutput defines the output from retrieving items It contains slices of items based on their state see: https://standardfile.org/ for state details.
Item describes a decrypted item.
No description provided by the author
ItemReference defines a reference from one item to another.
No description provided by the author
No description provided by the author
PutItemsInput defines the input used to put items.
PutItemsOutput defines the output from putting items.
No description provided by the author
Session holds authentication and encryption parameters required to communicate with the API and process transferred data.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

ClientStructure defines behaviour of an Item's content entry.
ClientStructure defines behaviour of a Component Item's content entry.
ClientStructure defines behaviour of a Component Item's content entry.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author