owl-blogs/app/repository/interfaces.go

25 lines
641 B
Go
Raw Normal View History

2023-06-25 18:04:06 +00:00
package repository
2023-07-06 17:36:24 +00:00
import (
"owl-blogs/domain/model"
"time"
)
2023-06-25 18:04:06 +00:00
type EntryRepository interface {
2023-07-06 17:36:24 +00:00
Create(entry model.Entry, publishedAt *time.Time, metaData model.EntryMetaData) error
2023-06-25 18:04:06 +00:00
Update(entry model.Entry) error
Delete(entry model.Entry) error
FindById(id string) (model.Entry, error)
FindAll(types *[]string) ([]model.Entry, error)
}
2023-07-08 09:08:55 +00:00
type BinaryRepository interface {
Create(name string, data []byte) (*model.BinaryFile, error)
FindById(id string) (*model.BinaryFile, error)
}
2023-07-08 11:28:06 +00:00
type AuthorRepository interface {
Create(name string, passwordHash string) (*model.Author, error)
FindByName(name string) (*model.Author, error)
}