quotes

package
v0.0.0-...-609b270 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

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 (r InmemRepo) GetAuthors() []string

func (InmemRepo) GetBooks

func (r InmemRepo) GetBooks() []string

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

Jump to

Keyboard shortcuts

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