repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_NOTEBOOK_ID = 1

DEFAULT_NOTEBOOK_ID is always set to 1. It defines the default notebook that is present at the DB. This notebook should never be deleted.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository interface {
	CreateAccount(username string, password []byte) error
	GetAccount(username string) (*model.Account, error)
	GetUsernames() []string
	DeleteAccount(username string) error
	CloseDB() error
}

AccountRepository ia an interface for handling DB related tasks fro Account

func NewAccountRepository

func NewAccountRepository(dbPath string) AccountRepository

NewAccountRepository returns a AccountRepository interface

type NoteRepository

type NoteRepository interface {
	SaveNote(note *model.Note) (int64, error)
	GetNotes(noteIDs []int64) ([]*model.Note, error)
	GetNote(noteID int64) (*model.Note, error)
	GetNotesByTag(tags []string) ([]*model.Note, error)
	UpdateNote(note *model.Note) error
	DeleteNotes(noteIDs []int64) error
	DeleteNote(noteIDs int64) error
	SearchNotesByKeyword(keyword string) ([]*model.Note, error)
	CloseDB() error
}

NoteRepository is an interface for handling DB related tasks for Note

func NewNoteRepository

func NewNoteRepository(dbPath string) NoteRepository

NewNoteRepository returns a NoteRepository interface.

type NotebookRepository

type NotebookRepository interface {
	SaveNotebook(notebook *model.Notebook) (int64, error)
	GetNotebooks(notebooksIDs []int64) ([]*model.Notebook, error)
	GetNotebook(notebooksID int64) (*model.Notebook, error)
	GetNotebookByTitle(notebookTitle string) (*model.Notebook, error)
	GetAllNotebooksTitle() (map[int64]string, error)
	UpdateNotebook(notebook *model.Notebook) error
	DeleteNotebooks(notebooksIDs []int64) error
	DeleteNotebook(notebooksID int64) error
	CloseDB() error
}

NotebookRepository is an interface for handling DB related tasks for Notebook

func NewNotebookRepository

func NewNotebookRepository(dbPath string) NotebookRepository

NewNotebookRepository returns a NotebookRepository interface

Jump to

Keyboard shortcuts

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