Documentation ¶
Index ¶
- Constants
- Variables
- type AuthenticatedAPI
- func (a *AuthenticatedAPI) DeleteNote(publicID string) (bool, error)
- func (a *AuthenticatedAPI) GetEndpoint() string
- func (a *AuthenticatedAPI) GetNote(publicID string) (*Note, error)
- func (a *AuthenticatedAPI) GetNotes() ([]*Note, error)
- func (a *AuthenticatedAPI) PostNewNote(n *Note) (*Note, error)
- func (a *AuthenticatedAPI) PutUpdateNote(n *Note) (*Note, error)
- type Note
- type NoteMeta
- type NoteTag
- type NoteText
- type Token
- type TokenRequest
- type TokenResponse
- type UnauthenticatedAPI
- type User
Constants ¶
const NoteOfEndpoint = "https://api.noteof.app"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AuthenticatedAPI ¶
type AuthenticatedAPI struct { UnauthenticatedAPI // contains filtered or unexported fields }
func NewAuthenticatedApi ¶
func NewAuthenticatedApi(token string) *AuthenticatedAPI
func (*AuthenticatedAPI) DeleteNote ¶
func (a *AuthenticatedAPI) DeleteNote(publicID string) (bool, error)
func (*AuthenticatedAPI) GetEndpoint ¶
func (a *AuthenticatedAPI) GetEndpoint() string
func (*AuthenticatedAPI) GetNote ¶
func (a *AuthenticatedAPI) GetNote(publicID string) (*Note, error)
func (*AuthenticatedAPI) GetNotes ¶
func (a *AuthenticatedAPI) GetNotes() ([]*Note, error)
func (*AuthenticatedAPI) PostNewNote ¶
func (a *AuthenticatedAPI) PostNewNote(n *Note) (*Note, error)
func (*AuthenticatedAPI) PutUpdateNote ¶
func (a *AuthenticatedAPI) PutUpdateNote(n *Note) (*Note, error)
type Note ¶
type Note struct { PublicID string `json:"public_id"` // UserID int `json:"-"` // NoteTextID int64 `json:"-"` // maybe get rid of? Archived bool `json:"archived"` Starred bool `json:"starred"` Created time.Time `json:"created"` Tags []NoteTag `json:"tags"` Meta NoteMeta `json:"meta"` CurrentText *NoteText `json:"current"` TextHistory []*NoteText `json:"history,omitempty"` }
type NoteMeta ¶
NoteMeta is a map of string keys to string values that can be used to store arbitrary metadata about a note that is not part of the note itself and is useful for implementation specific values.
The server enforces a 255 character limit on both keys and values. The key is expected to be ascii only and the value is expected to be utf-8
type NoteTag ¶
type NoteTag string
NoteTag is a string that includes methods for canonicalizing the tag as used by the server itself
func (NoteTag) C14n ¶
C14n provides the standard method by which tags are canonicalized.
The process involves converting the string to NFD normalization and removing all Combining Diacritical Marks
There should be little need to call this directly other than perhaps comparing strings that have not yet been canonicalized by the server, it is provided here as a helper for such comparison but shall not be needed before a roundtrip to the server.
type TokenRequest ¶
type TokenResponse ¶
type UnauthenticatedAPI ¶
type UnauthenticatedAPI struct {
// contains filtered or unexported fields
}
func (*UnauthenticatedAPI) DoAuth ¶
func (u *UnauthenticatedAPI) DoAuth(username, password, usage string) (*TokenResponse, error)
func (*UnauthenticatedAPI) GetEndpoint ¶
func (a *UnauthenticatedAPI) GetEndpoint() string