Documentation ¶
Index ¶
- type Context
- type NotesStore
- func (i NotesStore) Create(note model.Note) (*model.Note, error)
- func (i NotesStore) Delete(id int, userId int) (int, error)
- func (i NotesStore) DeleteAll(userId int) error
- func (i NotesStore) DropAll(userId int) error
- func (i NotesStore) FindByID(id int, userId int) *model.Note
- func (i NotesStore) FindByName(name string, userId int) []model.Note
- func (i NotesStore) FindByUserID(userId int) []model.Note
- func (i NotesStore) Update(id int, name string, userId int) (*model.Note, error)
- type Store
- type TodosStore
- func (i TodosStore) Create(todo model.Todo) (*model.Todo, error)
- func (i TodosStore) Delete(id int, noteID int) (int, error)
- func (i TodosStore) FindByID(id int) *model.Todo
- func (i TodosStore) FindByName(name string) []model.Todo
- func (i TodosStore) FindByNoteID(noteID int) []model.Todo
- func (i TodosStore) Toggle(id int) (*model.Todo, error)
- func (i TodosStore) Update(id int, name string, done *bool) (*model.Todo, error)
- type UsersStore
- func (i UsersStore) Create(user model.User) (*model.User, error)
- func (i UsersStore) Delete(id int) error
- func (i UsersStore) DeleteAll() error
- func (i UsersStore) FindByID(id int) *model.User
- func (i UsersStore) FindByName(name string) *model.User
- func (i UsersStore) UpdatePassword(user model.User) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotesStore ¶
type NotesStore struct {
// contains filtered or unexported fields
}
func NewNotesStore ¶
func NewNotesStore(ctx *Context) NotesStore
func (NotesStore) DeleteAll ¶
func (i NotesStore) DeleteAll(userId int) error
func (NotesStore) DropAll ¶
func (i NotesStore) DropAll(userId int) error
func (NotesStore) FindByName ¶
func (i NotesStore) FindByName(name string, userId int) []model.Note
func (NotesStore) FindByUserID ¶
func (i NotesStore) FindByUserID(userId int) []model.Note
type Store ¶
type Store struct { Users UsersStore Notes NotesStore Todos TodosStore // contains filtered or unexported fields }
type TodosStore ¶
type TodosStore struct {
// contains filtered or unexported fields
}
func NewTodosStore ¶
func NewTodosStore(ctx *Context) TodosStore
func (TodosStore) Delete ¶
func (i TodosStore) Delete(id int, noteID int) (int, error)
Tries to delete a user by id, and returns the number of records deleted;
func (TodosStore) FindByID ¶
func (i TodosStore) FindByID(id int) *model.Todo
Tries to find from id;
func (TodosStore) FindByName ¶
func (i TodosStore) FindByName(name string) []model.Todo
Tries to find from name;
func (TodosStore) FindByNoteID ¶
func (i TodosStore) FindByNoteID(noteID int) []model.Todo
Tries to find from note_id;
type UsersStore ¶
type UsersStore struct {
// contains filtered or unexported fields
}
func NewUsersStore ¶
func NewUsersStore(ctx *Context) UsersStore
func (UsersStore) Delete ¶
func (i UsersStore) Delete(id int) error
Tries to delete a user by id, and returns the number of records deleted;
func (UsersStore) DeleteAll ¶
func (i UsersStore) DeleteAll() error
Removes all records from the table;
func (UsersStore) FindByID ¶
func (i UsersStore) FindByID(id int) *model.User
Tries to find a user from id;
func (UsersStore) FindByName ¶
func (i UsersStore) FindByName(name string) *model.User
Tries to find a user from name;
func (UsersStore) UpdatePassword ¶
func (i UsersStore) UpdatePassword(user model.User) (int, error)
Click to show internal directories.
Click to hide internal directories.