-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.go
30 lines (26 loc) · 1000 Bytes
/
store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package dusk
import (
"github.com/kencx/dusk/filters"
"github.com/kencx/dusk/page"
)
type Store interface {
GetBook(id int64) (*Book, error)
GetAllBooks(filters *filters.Book) (*page.Page[Book], error)
CreateBook(b *Book) (*Book, error)
UpdateBook(id int64, b *Book) (*Book, error)
DeleteBook(id int64) error
GetAuthor(id int64) (*Author, error)
GetAuthorsFromBook(id int64) ([]Author, error)
GetAllAuthors(filters *filters.Search) (*page.Page[Author], error)
GetAllBooksFromAuthor(id int64, filters *filters.Book) (*page.Page[Book], error)
CreateAuthor(a *Author) (*Author, error)
UpdateAuthor(id int64, a *Author) (*Author, error)
DeleteAuthor(id int64) error
GetTag(id int64) (*Tag, error)
GetTagsFromBook(id int64) ([]Tag, error)
GetAllTags(filters *filters.Search) (*page.Page[Tag], error)
GetAllBooksFromTag(id int64, filters *filters.Book) (*page.Page[Book], error)
CreateTag(t *Tag) (*Tag, error)
UpdateTag(id int64, t *Tag) (*Tag, error)
DeleteTag(id int64) error
}