Documentation
¶
Index ¶
Constants ¶
View Source
const MaxStringLen = 131070
Always a good idea to have a upper limit
Variables ¶
View Source
var ( Basic = "basic" URL = "url" NoteTypes = []string{ Basic, URL, } )
Note types
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface {
GetAllNotes(sortBy, order string) (Notes, error)
GetAllBookNotes(book *Book, sortBy, order string) (Notes, error)
GetNoteByID(id int64) (*Note, error)
GetNoteByNote(n *Note) error
GetNotesByIDs(ids []int64) (Notes, error)
CreateNote(n *Note) error
EditNote(n *Note) error
DeleteNote(n *Note) error
GetAllBooks() (Books, error)
GetOrCreateBookByName(name string) (*Book, error)
GetBookByName(name string) (*Book, error)
CreateBook(b *Book) error
MergeBooks(b1 *Book, b2 *Book) error
EditNoteByIDBook(ids []int64, bk *Book) error
EditBook(b1 *Book) error
LoadBook(b *Book) error
DeleteBook(bk *Book) error
GetAllBookTags(bk *Book) (Tags, error)
GetAllTags() (Tags, error)
CreateTag(t *Tag) error
LoadNoteTags(n *Note) error
GetOrCreateTagByName(name string) (*Tag, error)
GetTagByName(name string) (*Tag, error)
Close() error
}
DB interface for the database providers
type Index ¶
type Index interface {
IndexNote(n *Note) error
IndexNotes(notes Notes) error
SearchNote(query string, limit, offset int) ([]int64, uint64, error)
SearchNotePhrase(query string, bk *Book, sort string, limit, offset int) ([]int64, uint64, error)
DeleteNote(n *Note) error
DeleteBook(bk *Book) error
}
Index interface for the index providers
type Note ¶
type Note struct {
ID int64
Created time.Time
Modified time.Time
Type string
Title string
Body string
Book *Book
Tags []*Tag
}
Note is our main struct for storing notes and their meta data.
func (*Note) GetTagIDsArray ¶
func (*Note) GetTagStringArray ¶
GetTagStringArray returns a list of the note's tag names
func (*Note) MarshalJSON ¶
MarshalJSON customer json Marshaler
Click to show internal directories.
Click to hide internal directories.