testdomain

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBooksForAuthors

func GetBooksForAuthors(system *SystemInstance, ids []string) ([][]*model.Book, error)

Types

type Author

type Author struct {
	System   *SystemInstance
	AuthorId string
	DBAuthor *model.Author
}

func CreateAuthor

func CreateAuthor(system *SystemInstance) *Author

func (*Author) ClearCacheData

func (a *Author) ClearCacheData(ctx context.Context)

func (*Author) ClearData

func (a *Author) ClearData(ctx context.Context)

func (*Author) CreateBook

func (a *Author) CreateBook(ctx context.Context, status string) (*Book, error)

func (*Author) GetBooks

func (a *Author) GetBooks(ctx context.Context) ([]*model.Book, error)

func (*Author) VerifyBookIsCached

func (a *Author) VerifyBookIsCached(ctx context.Context, bookId, status string) bool

type Book

type Book struct {
	System *SystemInstance
	BookId string
	DBBook *model.Book
}

func CreateBook

func CreateBook(system *SystemInstance, authorId, status string) (*Book, error)

func (*Book) ClearCacheData

func (b *Book) ClearCacheData(ctx context.Context)

func (*Book) ClearData

func (b *Book) ClearData(ctx context.Context)

func (*Book) PartialUpdateStatus added in v0.3.0

func (b *Book) PartialUpdateStatus(ctx context.Context, newStatus string) error

func (*Book) UpdateStatus

func (b *Book) UpdateStatus(ctx context.Context, newStatus string) error

func (*Book) VerifyBookExists

func (b *Book) VerifyBookExists(ctx context.Context) bool

func (*Book) VerifyBookIsCached

func (b *Book) VerifyBookIsCached(ctx context.Context) bool

type SystemInstance

type SystemInstance struct {
	Ctx                     context.Context
	DB                      *gorm.DB
	BookCacheStore          stats.StatsCacheStore
	UniqueKeyDataFetcher    statsrepo.StatsDataFetcher
	NonUniqueKeyDataFetcher statsrepo.StatsDataFetcher
	BookRepo                datarepo.CachedRepository
}

Jump to

Keyboard shortcuts

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