notes

package
v0.0.0-...-e452e83 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DDBTable string

DDBTable is the DynamoDB table storing the notes data.

Functions

func CreateNote

func CreateNote(userID string, content string) error

CreateNote creates a new note to be stored in the user's account.

func DeleteNote

func DeleteNote(noteID string) error

DeleteNote removes the stored note from the user's account.

func UpdateNote

func UpdateNote(noteID string, contentUpdate string) error

UpdateNote modifies the stored note with newly submitted contents.

func UpdateNoteView

func UpdateNoteView(noteID string) error

UpdateNoteView adds +1 to the given note's view count.

Types

type Note

type Note struct {
	NoteID           string
	UserID           string
	LastModifiedDate string
	CreationDate     string
	Content          string
	Views            int
}

Note represents a single note that can be interacted with by the user.

func ReadAllNotes

func ReadAllNotes(userID string) ([]Note, error)

ReadAllNotes returns all the notes stored in the user's account.

func ReadNote

func ReadNote(noteID string) (Note, error)

ReadNote returns the stored note with the given ID.

type NotePage

type NotePage struct {
	Notes []Note
}

NotePage represents a page of notes.

Jump to

Keyboard shortcuts

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