Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBQuotesRepository ¶
type DBQuotesRepository interface { QuotesRepository GetQuotes(ctx context.Context) ([]KindleQuote, error) ImportQuotes(ctx context.Context, quotes []KindleQuote) (int, error) }
func CreateRepository ¶
func CreateRepository(database *pgxpool.Pool) DBQuotesRepository
type DBRepository ¶
type DBRepository struct {
// contains filtered or unexported fields
}
func (DBRepository) GetQuotes ¶
func (qr DBRepository) GetQuotes(ctx context.Context) ([]KindleQuote, error)
func (DBRepository) ImportQuotes ¶
func (qr DBRepository) ImportQuotes(ctx context.Context, quotes []KindleQuote) (int, error)
type InmemRepo ¶
type InmemRepo struct { QuotesRepository // contains filtered or unexported fields }
func (InmemRepo) GetAuthors ¶
func (InmemRepo) GetQuotesByAuthor ¶
func (r InmemRepo) GetQuotesByAuthor(author string) []KindleQuote
func (InmemRepo) GetQuotesByTitle ¶
func (r InmemRepo) GetQuotesByTitle(book string) []KindleQuote
type KindleQuote ¶
type KindleQuote struct { Title string `db:"source_title"` Author string `db:"author_name"` Date string `db:"date_taken"` Quote string `db:"quote"` }
func (*KindleQuote) ParseDate ¶
func (quote *KindleQuote) ParseDate(dateLine string)
func (*KindleQuote) ParseTitleAndAuthor ¶
func (quote *KindleQuote) ParseTitleAndAuthor(titleLine string)
func (KindleQuote) String ¶
func (quote KindleQuote) String()
type QuotesRepository ¶
type QuotesRepository interface { }
func New ¶
func New(qs []KindleQuote) QuotesRepository
Click to show internal directories.
Click to hide internal directories.