note

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(id string, uid string) (bool, error)

Delete is used to delete a note from database

Types

type Note

type Note struct {
	ID           primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	UID          string             `json:"uid" bson:"uid"`
	Title        string             `json:"title" bson:"title,omitempty"`
	Data         string             `json:"data" bson:"data,omitempty"`
	LastModified time.Time          `json:"lastModified" bson:"lastModified,omitempty"`
	IsPinned     bool               `json:"ispinned" bson:"ispinned,omitempty"`
	Label        string             `json:"label" bson:"label,omitempty"`
	Color        string             `json:"color" bson:"color,omitempty"`
}

Note type is the basic struct type that represents a user note

func Edit

func Edit(enr requests.EditNoteRequest, uid string) (Note, error)

Edit is used to update existing note records

func Get

func Get(id, uid string) (Note, error)

Get is used to retrive note of the current user

func GetAll

func GetAll(uid string) ([]Note, error)

GetAll is used to retrive all notes of the current user

func Set

func Set(n Note) (Note, error)

Set is used to create a new note

Jump to

Keyboard shortcuts

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