db

package
v0.0.0-...-fec4e2b Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_WAIT_DELAY_MSECS = 500
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artist

type Artist struct {
	ID         int64     `db:"id" json:"id"`
	Name       string    `db:"name" json:"name"`
	ImageUrl   string    `db:"image_url" json:"imageUrl"`
	WebsiteUrl string    `db:"website_url" json:"websiteUrl"`
	Variants   []string  `db:"variants" json:"variants"`
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
}

type Batch

type Batch struct {
	ID                   int64     `db:"id" json:"id"`
	NumRequiredSearches  int       `db:"req_searches" json:"numRequiredSearches"`
	NumCompletedSearches int       `db:"completed_searches" json:"numCompletedSearches"`
	CreatedAt            time.Time `db:"created_at"`
	UpdatedAt            time.Time `db:"updated_at"`
	ReportedAt           time.Time `db:"reported_at" json:"reportedAt"`
}

type BatchedReport

type BatchedReport struct {
	ReportID  int64  `db:"report_id" json:"reportId"`
	UserID    int64  `db:"user_id" json:"userId"`
	UserName  string `db:"user_name" json:"userName"`
	UserEmail string `db:"user_email" json:"userEmail"`
	BatchID   int64  `db:"batch_id" json:"batchId"`
}

type Release

type Release struct {
	ID        int64     `db:"id" json:"id"`
	Name      string    `db:"name" json:"name"`
	ArtistID  int64     `db:"artist_id" json:"artistID"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Report

type Report struct {
	ID          int64     `db:"id" json:"id"`
	UserID      int64     `db:"user_id" json:"userId"`
	BatchID     int64     `db:"batch_id" json:"batchId"`
	CreatedAt   time.Time `db:"created_at" json:"createdAt"`
	UpdatedAt   time.Time `db:"updated_at"`
	CompletedAt null.Time `db:"completed_at" json:"completedAt"`
	SentAt      null.Time `db:"sent_at" json:"sentAt"`
}

type Retailer

type Retailer struct {
	ID        int64     `db:"id" json:"id"`
	Name      string    `db:"name" json:"name"`
	Url       string    `db:"url" json:"url"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type SKU

type SKU struct {
	ID         int64     `db:"id" json:"id"`
	Name       string    `json:"name"`
	ReleaseID  int64     `db:"release_id" json:"releaseId"`
	RetailerID int64     `db:"retailer_id" json:"retailerId"`
	ArtistID   int64     `db:"artist_id" json:"artistId"`
	ItemUrl    string    `db:"item_url" json:"itemUrl"`
	ImageUrl   string    `db:"image_url" json:"imageUrl"`
	Price      string    `db:"price" json:"price"`
	CreatedAt  time.Time `db:"created_at" json:"createdAt"`
}

type VinylDB

type VinylDB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(db *postgres.DB) VinylDB

func (*VinylDB) AddNewBatch

func (v *VinylDB) AddNewBatch(tx *postgres.Tx, numRequiredSearches int, userArtists map[int64][]WatchedArtist) (batchId int64, err error)

AddNewBatch Create a new batch instance, representing one full set of scans to be completed over the set of users currently watching a set of artists. This batch instance will have a set of empty reports connected to it, one per watching user, and each such report will cover the set of artists currently being watched by the user for whom the report pertains. The batch also stores the required number of searches to be performed (artist x retailer) so that we can keep track of whether a batch has been completed or not.

func (*VinylDB) AddSKUToReportsForBatch

func (v *VinylDB) AddSKUToReportsForBatch(tx *postgres.Tx, batchId int64, sku *SKU) error

AddSKUToReportsForBatch Given a particular SKU sound for an artist + retailer, this method looks at all the reports attached to the current batch, determines if the SKU artist is covered by the report, and if so attaches the SKU to the final report. We assume that it has already been determined whether the SKU represents a valid result for the report (for example the price has changed).

func (*VinylDB) CloseTransaction

func (v *VinylDB) CloseTransaction(tx *postgres.Tx, err error) error

func (*VinylDB) DeleteBatch

func (v *VinylDB) DeleteBatch(tx *postgres.Tx, batchId int64) error

func (*VinylDB) DeleteReport

func (v *VinylDB) DeleteReport(tx *postgres.Tx, reportId int64) error

func (*VinylDB) DeleteReportsForBatch

func (v *VinylDB) DeleteReportsForBatch(tx *postgres.Tx, batchId int64) error

func (*VinylDB) GetAllArtists

func (v *VinylDB) GetAllArtists(tx *postgres.Tx) ([]Artist, error)

func (*VinylDB) GetAllCompletedUnsentReports

func (v *VinylDB) GetAllCompletedUnsentReports(tx *postgres.Tx) ([]BatchedReport, error)

func (*VinylDB) GetAllRetailers

func (v *VinylDB) GetAllRetailers(tx *postgres.Tx) ([]Retailer, error)

func (*VinylDB) GetAllSKUs

func (v *VinylDB) GetAllSKUs(tx *postgres.Tx, artistId *int64, retailerId *int64) ([]SKU, error)

func (*VinylDB) GetCurrentSKUForRelease

func (v *VinylDB) GetCurrentSKUForRelease(tx *postgres.Tx, releaseID int64, retailerID int64) (*SKU, error)

func (*VinylDB) GetSkusForReport

func (v *VinylDB) GetSkusForReport(tx *postgres.Tx, reportId int64) ([]retailers.SKU, error)

func (*VinylDB) GetWatchedArtists

func (v *VinylDB) GetWatchedArtists(tx *postgres.Tx) (map[int64][]WatchedArtist, error)

func (*VinylDB) IncrementBatchSearchCompletedCount

func (v *VinylDB) IncrementBatchSearchCompletedCount(tx *postgres.Tx, batchId int64) error

IncrementBatchSearchCompletedCount When scanning is complete for a specific artist + retailer, this method allows the scanner to increment the number of scans completed that is stored against the batch. We use UPDATE here as an atomic operation on the batches table and as such this method will be thread-safe in terms of getting all increments.

func (*VinylDB) MarkBatchReported

func (v *VinylDB) MarkBatchReported(tx *postgres.Tx, batchId int64) error

func (*VinylDB) MarkReportSent

func (v *VinylDB) MarkReportSent(tx *postgres.Tx, reportId int64) error

func (*VinylDB) Q

func (v *VinylDB) Q(tx *postgres.Tx) postgres.Querier

func (*VinylDB) StartTransaction

func (v *VinylDB) StartTransaction() (*postgres.Tx, error)

func (*VinylDB) UpdateSKU

func (v *VinylDB) UpdateSKU(tx *postgres.Tx, sku *SKU) error

func (*VinylDB) UpsertRelease

func (v *VinylDB) UpsertRelease(tx *postgres.Tx, artistId int64, title string) (id int64, err error)

func (*VinylDB) UpsertSKU

func (v *VinylDB) UpsertSKU(tx *postgres.Tx, sku *SKU) (same bool, err error)

func (*VinylDB) VerifySchema

func (v *VinylDB) VerifySchema() error

func (*VinylDB) WaitForDbUp

func (v *VinylDB) WaitForDbUp(timeoutSecs int64) error

type VinylDS

type VinylDS interface {
	//
	// AddNewBatch
	// Create a new batch instance, representing one full set of scans to be completed over the set of users
	// currently watching a set of artists. This batch instance will have a set of empty reports connected to
	// it, one per watching user, and each such report will cover the set of artists currently being watched
	// by the user for whom the report pertains. The batch also stores the required number of searches to be
	// performed (artist x retailer) so that we can keep track of whether a batch has been completed or not.
	//
	AddNewBatch(tx *postgres.Tx, numRequiredSearches int, userArtists map[int64][]WatchedArtist) (batchId int64, err error)
	//
	// AddSKUToReportsForBatch
	// Given a particular SKU sound for an artist + retailer, this method looks at all the reports attached to the
	// current batch, determines if the SKU artist is covered by the report, and if so attaches the SKU to the final
	// report. We assume that it has already been determined whether the SKU represents a valid result for the report
	// (for example the price has changed).
	//
	AddSKUToReportsForBatch(tx *postgres.Tx, batchId int64, sku *SKU) error
	CloseTransaction(tx *postgres.Tx, err error) error
	DeleteBatch(tx *postgres.Tx, batchId int64) error
	DeleteReport(tx *postgres.Tx, reportId int64) error
	DeleteReportsForBatch(tx *postgres.Tx, batchId int64) error
	GetAllArtists(tx *postgres.Tx) ([]Artist, error)
	GetAllCompletedUnsentReports(tx *postgres.Tx) ([]BatchedReport, error)
	GetAllRetailers(tx *postgres.Tx) ([]Retailer, error)
	GetAllSKUs(tx *postgres.Tx, artistId *int64, retailerId *int64) ([]SKU, error)
	GetCurrentSKUForRelease(tx *postgres.Tx, releaseID int64, retailerID int64) (*SKU, error)
	GetSkusForReport(tx *postgres.Tx, reportId int64) ([]retailers.SKU, error)
	GetWatchedArtists(tx *postgres.Tx) (map[int64][]WatchedArtist, error)
	//
	// IncrementBatchSearchCompletedCount
	// When scanning is complete for a specific artist + retailer, this method allows the scanner to increment
	// the number of scans completed that is stored against the batch. We use UPDATE here as an atomic operation
	// on the batches table and as such this method will be thread-safe in terms of getting all increments.
	//
	IncrementBatchSearchCompletedCount(tx *postgres.Tx, batchId int64) error
	MarkBatchReported(tx *postgres.Tx, batchId int64) error
	MarkReportSent(tx *postgres.Tx, reportId int64) error
	Q(tx *postgres.Tx) postgres.Querier
	StartTransaction() (*postgres.Tx, error)
	UpdateSKU(tx *postgres.Tx, sku *SKU) error
	UpsertRelease(tx *postgres.Tx, artistId int64, title string) (id int64, err error)
	UpsertSKU(tx *postgres.Tx, sku *SKU) (same bool, err error)
	VerifySchema() error
	WaitForDbUp(timeoutSecs int64) error
}

VinylDS ...

type VinylDSMock

type VinylDSMock struct {
	// AddNewBatchFunc mocks the AddNewBatch method.
	AddNewBatchFunc func(tx *postgres.Tx, numRequiredSearches int, userArtists map[int64][]WatchedArtist) (int64, error)

	// AddSKUToReportsForBatchFunc mocks the AddSKUToReportsForBatch method.
	AddSKUToReportsForBatchFunc func(tx *postgres.Tx, batchId int64, sku *SKU) error

	// CloseTransactionFunc mocks the CloseTransaction method.
	CloseTransactionFunc func(tx *postgres.Tx, err error) error

	// DeleteBatchFunc mocks the DeleteBatch method.
	DeleteBatchFunc func(tx *postgres.Tx, batchId int64) error

	// DeleteReportFunc mocks the DeleteReport method.
	DeleteReportFunc func(tx *postgres.Tx, reportId int64) error

	// DeleteReportsForBatchFunc mocks the DeleteReportsForBatch method.
	DeleteReportsForBatchFunc func(tx *postgres.Tx, batchId int64) error

	// GetAllArtistsFunc mocks the GetAllArtists method.
	GetAllArtistsFunc func(tx *postgres.Tx) ([]Artist, error)

	// GetAllCompletedUnsentReportsFunc mocks the GetAllCompletedUnsentReports method.
	GetAllCompletedUnsentReportsFunc func(tx *postgres.Tx) ([]BatchedReport, error)

	// GetAllRetailersFunc mocks the GetAllRetailers method.
	GetAllRetailersFunc func(tx *postgres.Tx) ([]Retailer, error)

	// GetAllSKUsFunc mocks the GetAllSKUs method.
	GetAllSKUsFunc func(tx *postgres.Tx, artistId *int64, retailerId *int64) ([]SKU, error)

	// GetCurrentSKUForReleaseFunc mocks the GetCurrentSKUForRelease method.
	GetCurrentSKUForReleaseFunc func(tx *postgres.Tx, releaseID int64, retailerID int64) (*SKU, error)

	// GetSkusForReportFunc mocks the GetSkusForReport method.
	GetSkusForReportFunc func(tx *postgres.Tx, reportId int64) ([]retailers.SKU, error)

	// GetWatchedArtistsFunc mocks the GetWatchedArtists method.
	GetWatchedArtistsFunc func(tx *postgres.Tx) (map[int64][]WatchedArtist, error)

	// IncrementBatchSearchCompletedCountFunc mocks the IncrementBatchSearchCompletedCount method.
	IncrementBatchSearchCompletedCountFunc func(tx *postgres.Tx, batchId int64) error

	// MarkBatchReportedFunc mocks the MarkBatchReported method.
	MarkBatchReportedFunc func(tx *postgres.Tx, batchId int64) error

	// MarkReportSentFunc mocks the MarkReportSent method.
	MarkReportSentFunc func(tx *postgres.Tx, reportId int64) error

	// QFunc mocks the Q method.
	QFunc func(tx *postgres.Tx) postgres.Querier

	// StartTransactionFunc mocks the StartTransaction method.
	StartTransactionFunc func() (*postgres.Tx, error)

	// UpdateSKUFunc mocks the UpdateSKU method.
	UpdateSKUFunc func(tx *postgres.Tx, sku *SKU) error

	// UpsertReleaseFunc mocks the UpsertRelease method.
	UpsertReleaseFunc func(tx *postgres.Tx, artistId int64, title string) (int64, error)

	// UpsertSKUFunc mocks the UpsertSKU method.
	UpsertSKUFunc func(tx *postgres.Tx, sku *SKU) (bool, error)

	// VerifySchemaFunc mocks the VerifySchema method.
	VerifySchemaFunc func() error

	// WaitForDbUpFunc mocks the WaitForDbUp method.
	WaitForDbUpFunc func(timeoutSecs int64) error
	// contains filtered or unexported fields
}

VinylDSMock is a mock implementation of VinylDS.

func TestSomethingThatUsesVinylDS(t *testing.T) {

	// make and configure a mocked VinylDS
	mockedVinylDS := &VinylDSMock{
		AddNewBatchFunc: func(tx *postgres.Tx, numRequiredSearches int, userArtists map[int64][]WatchedArtist) (int64, error) {
			panic("mock out the AddNewBatch method")
		},
		AddSKUToReportsForBatchFunc: func(tx *postgres.Tx, batchId int64, sku *SKU) error {
			panic("mock out the AddSKUToReportsForBatch method")
		},
		CloseTransactionFunc: func(tx *postgres.Tx, err error) error {
			panic("mock out the CloseTransaction method")
		},
		DeleteBatchFunc: func(tx *postgres.Tx, batchId int64) error {
			panic("mock out the DeleteBatch method")
		},
		DeleteReportFunc: func(tx *postgres.Tx, reportId int64) error {
			panic("mock out the DeleteReport method")
		},
		DeleteReportsForBatchFunc: func(tx *postgres.Tx, batchId int64) error {
			panic("mock out the DeleteReportsForBatch method")
		},
		GetAllArtistsFunc: func(tx *postgres.Tx) ([]Artist, error) {
			panic("mock out the GetAllArtists method")
		},
		GetAllCompletedUnsentReportsFunc: func(tx *postgres.Tx) ([]BatchedReport, error) {
			panic("mock out the GetAllCompletedUnsentReports method")
		},
		GetAllRetailersFunc: func(tx *postgres.Tx) ([]Retailer, error) {
			panic("mock out the GetAllRetailers method")
		},
		GetAllSKUsFunc: func(tx *postgres.Tx, artistId *int64, retailerId *int64) ([]SKU, error) {
			panic("mock out the GetAllSKUs method")
		},
		GetCurrentSKUForReleaseFunc: func(tx *postgres.Tx, releaseID int64, retailerID int64) (*SKU, error) {
			panic("mock out the GetCurrentSKUForRelease method")
		},
		GetSkusForReportFunc: func(tx *postgres.Tx, reportId int64) ([]retailers.SKU, error) {
			panic("mock out the GetSkusForReport method")
		},
		GetWatchedArtistsFunc: func(tx *postgres.Tx) (map[int64][]WatchedArtist, error) {
			panic("mock out the GetWatchedArtists method")
		},
		IncrementBatchSearchCompletedCountFunc: func(tx *postgres.Tx, batchId int64) error {
			panic("mock out the IncrementBatchSearchCompletedCount method")
		},
		MarkBatchReportedFunc: func(tx *postgres.Tx, batchId int64) error {
			panic("mock out the MarkBatchReported method")
		},
		MarkReportSentFunc: func(tx *postgres.Tx, reportId int64) error {
			panic("mock out the MarkReportSent method")
		},
		QFunc: func(tx *postgres.Tx) postgres.Querier {
			panic("mock out the Q method")
		},
		StartTransactionFunc: func() (*postgres.Tx, error) {
			panic("mock out the StartTransaction method")
		},
		UpdateSKUFunc: func(tx *postgres.Tx, sku *SKU) error {
			panic("mock out the UpdateSKU method")
		},
		UpsertReleaseFunc: func(tx *postgres.Tx, artistId int64, title string) (int64, error) {
			panic("mock out the UpsertRelease method")
		},
		UpsertSKUFunc: func(tx *postgres.Tx, sku *SKU) (bool, error) {
			panic("mock out the UpsertSKU method")
		},
		VerifySchemaFunc: func() error {
			panic("mock out the VerifySchema method")
		},
		WaitForDbUpFunc: func(timeoutSecs int64) error {
			panic("mock out the WaitForDbUp method")
		},
	}

	// use mockedVinylDS in code that requires VinylDS
	// and then make assertions.

}

func (*VinylDSMock) AddNewBatch

func (mock *VinylDSMock) AddNewBatch(tx *postgres.Tx, numRequiredSearches int, userArtists map[int64][]WatchedArtist) (int64, error)

AddNewBatch calls AddNewBatchFunc.

func (*VinylDSMock) AddNewBatchCalls

func (mock *VinylDSMock) AddNewBatchCalls() []struct {
	Tx                  *postgres.Tx
	NumRequiredSearches int
	UserArtists         map[int64][]WatchedArtist
}

AddNewBatchCalls gets all the calls that were made to AddNewBatch. Check the length with:

len(mockedVinylDS.AddNewBatchCalls())

func (*VinylDSMock) AddSKUToReportsForBatch

func (mock *VinylDSMock) AddSKUToReportsForBatch(tx *postgres.Tx, batchId int64, sku *SKU) error

AddSKUToReportsForBatch calls AddSKUToReportsForBatchFunc.

func (*VinylDSMock) AddSKUToReportsForBatchCalls

func (mock *VinylDSMock) AddSKUToReportsForBatchCalls() []struct {
	Tx      *postgres.Tx
	BatchId int64
	Sku     *SKU
}

AddSKUToReportsForBatchCalls gets all the calls that were made to AddSKUToReportsForBatch. Check the length with:

len(mockedVinylDS.AddSKUToReportsForBatchCalls())

func (*VinylDSMock) CloseTransaction

func (mock *VinylDSMock) CloseTransaction(tx *postgres.Tx, err error) error

CloseTransaction calls CloseTransactionFunc.

func (*VinylDSMock) CloseTransactionCalls

func (mock *VinylDSMock) CloseTransactionCalls() []struct {
	Tx  *postgres.Tx
	Err error
}

CloseTransactionCalls gets all the calls that were made to CloseTransaction. Check the length with:

len(mockedVinylDS.CloseTransactionCalls())

func (*VinylDSMock) DeleteBatch

func (mock *VinylDSMock) DeleteBatch(tx *postgres.Tx, batchId int64) error

DeleteBatch calls DeleteBatchFunc.

func (*VinylDSMock) DeleteBatchCalls

func (mock *VinylDSMock) DeleteBatchCalls() []struct {
	Tx      *postgres.Tx
	BatchId int64
}

DeleteBatchCalls gets all the calls that were made to DeleteBatch. Check the length with:

len(mockedVinylDS.DeleteBatchCalls())

func (*VinylDSMock) DeleteReport

func (mock *VinylDSMock) DeleteReport(tx *postgres.Tx, reportId int64) error

DeleteReport calls DeleteReportFunc.

func (*VinylDSMock) DeleteReportCalls

func (mock *VinylDSMock) DeleteReportCalls() []struct {
	Tx       *postgres.Tx
	ReportId int64
}

DeleteReportCalls gets all the calls that were made to DeleteReport. Check the length with:

len(mockedVinylDS.DeleteReportCalls())

func (*VinylDSMock) DeleteReportsForBatch

func (mock *VinylDSMock) DeleteReportsForBatch(tx *postgres.Tx, batchId int64) error

DeleteReportsForBatch calls DeleteReportsForBatchFunc.

func (*VinylDSMock) DeleteReportsForBatchCalls

func (mock *VinylDSMock) DeleteReportsForBatchCalls() []struct {
	Tx      *postgres.Tx
	BatchId int64
}

DeleteReportsForBatchCalls gets all the calls that were made to DeleteReportsForBatch. Check the length with:

len(mockedVinylDS.DeleteReportsForBatchCalls())

func (*VinylDSMock) GetAllArtists

func (mock *VinylDSMock) GetAllArtists(tx *postgres.Tx) ([]Artist, error)

GetAllArtists calls GetAllArtistsFunc.

func (*VinylDSMock) GetAllArtistsCalls

func (mock *VinylDSMock) GetAllArtistsCalls() []struct {
	Tx *postgres.Tx
}

GetAllArtistsCalls gets all the calls that were made to GetAllArtists. Check the length with:

len(mockedVinylDS.GetAllArtistsCalls())

func (*VinylDSMock) GetAllCompletedUnsentReports

func (mock *VinylDSMock) GetAllCompletedUnsentReports(tx *postgres.Tx) ([]BatchedReport, error)

GetAllCompletedUnsentReports calls GetAllCompletedUnsentReportsFunc.

func (*VinylDSMock) GetAllCompletedUnsentReportsCalls

func (mock *VinylDSMock) GetAllCompletedUnsentReportsCalls() []struct {
	Tx *postgres.Tx
}

GetAllCompletedUnsentReportsCalls gets all the calls that were made to GetAllCompletedUnsentReports. Check the length with:

len(mockedVinylDS.GetAllCompletedUnsentReportsCalls())

func (*VinylDSMock) GetAllRetailers

func (mock *VinylDSMock) GetAllRetailers(tx *postgres.Tx) ([]Retailer, error)

GetAllRetailers calls GetAllRetailersFunc.

func (*VinylDSMock) GetAllRetailersCalls

func (mock *VinylDSMock) GetAllRetailersCalls() []struct {
	Tx *postgres.Tx
}

GetAllRetailersCalls gets all the calls that were made to GetAllRetailers. Check the length with:

len(mockedVinylDS.GetAllRetailersCalls())

func (*VinylDSMock) GetAllSKUs

func (mock *VinylDSMock) GetAllSKUs(tx *postgres.Tx, artistId *int64, retailerId *int64) ([]SKU, error)

GetAllSKUs calls GetAllSKUsFunc.

func (*VinylDSMock) GetAllSKUsCalls

func (mock *VinylDSMock) GetAllSKUsCalls() []struct {
	Tx         *postgres.Tx
	ArtistId   *int64
	RetailerId *int64
}

GetAllSKUsCalls gets all the calls that were made to GetAllSKUs. Check the length with:

len(mockedVinylDS.GetAllSKUsCalls())

func (*VinylDSMock) GetCurrentSKUForRelease

func (mock *VinylDSMock) GetCurrentSKUForRelease(tx *postgres.Tx, releaseID int64, retailerID int64) (*SKU, error)

GetCurrentSKUForRelease calls GetCurrentSKUForReleaseFunc.

func (*VinylDSMock) GetCurrentSKUForReleaseCalls

func (mock *VinylDSMock) GetCurrentSKUForReleaseCalls() []struct {
	Tx         *postgres.Tx
	ReleaseID  int64
	RetailerID int64
}

GetCurrentSKUForReleaseCalls gets all the calls that were made to GetCurrentSKUForRelease. Check the length with:

len(mockedVinylDS.GetCurrentSKUForReleaseCalls())

func (*VinylDSMock) GetSkusForReport

func (mock *VinylDSMock) GetSkusForReport(tx *postgres.Tx, reportId int64) ([]retailers.SKU, error)

GetSkusForReport calls GetSkusForReportFunc.

func (*VinylDSMock) GetSkusForReportCalls

func (mock *VinylDSMock) GetSkusForReportCalls() []struct {
	Tx       *postgres.Tx
	ReportId int64
}

GetSkusForReportCalls gets all the calls that were made to GetSkusForReport. Check the length with:

len(mockedVinylDS.GetSkusForReportCalls())

func (*VinylDSMock) GetWatchedArtists

func (mock *VinylDSMock) GetWatchedArtists(tx *postgres.Tx) (map[int64][]WatchedArtist, error)

GetWatchedArtists calls GetWatchedArtistsFunc.

func (*VinylDSMock) GetWatchedArtistsCalls

func (mock *VinylDSMock) GetWatchedArtistsCalls() []struct {
	Tx *postgres.Tx
}

GetWatchedArtistsCalls gets all the calls that were made to GetWatchedArtists. Check the length with:

len(mockedVinylDS.GetWatchedArtistsCalls())

func (*VinylDSMock) IncrementBatchSearchCompletedCount

func (mock *VinylDSMock) IncrementBatchSearchCompletedCount(tx *postgres.Tx, batchId int64) error

IncrementBatchSearchCompletedCount calls IncrementBatchSearchCompletedCountFunc.

func (*VinylDSMock) IncrementBatchSearchCompletedCountCalls

func (mock *VinylDSMock) IncrementBatchSearchCompletedCountCalls() []struct {
	Tx      *postgres.Tx
	BatchId int64
}

IncrementBatchSearchCompletedCountCalls gets all the calls that were made to IncrementBatchSearchCompletedCount. Check the length with:

len(mockedVinylDS.IncrementBatchSearchCompletedCountCalls())

func (*VinylDSMock) MarkBatchReported

func (mock *VinylDSMock) MarkBatchReported(tx *postgres.Tx, batchId int64) error

MarkBatchReported calls MarkBatchReportedFunc.

func (*VinylDSMock) MarkBatchReportedCalls

func (mock *VinylDSMock) MarkBatchReportedCalls() []struct {
	Tx      *postgres.Tx
	BatchId int64
}

MarkBatchReportedCalls gets all the calls that were made to MarkBatchReported. Check the length with:

len(mockedVinylDS.MarkBatchReportedCalls())

func (*VinylDSMock) MarkReportSent

func (mock *VinylDSMock) MarkReportSent(tx *postgres.Tx, reportId int64) error

MarkReportSent calls MarkReportSentFunc.

func (*VinylDSMock) MarkReportSentCalls

func (mock *VinylDSMock) MarkReportSentCalls() []struct {
	Tx       *postgres.Tx
	ReportId int64
}

MarkReportSentCalls gets all the calls that were made to MarkReportSent. Check the length with:

len(mockedVinylDS.MarkReportSentCalls())

func (*VinylDSMock) Q

func (mock *VinylDSMock) Q(tx *postgres.Tx) postgres.Querier

Q calls QFunc.

func (*VinylDSMock) QCalls

func (mock *VinylDSMock) QCalls() []struct {
	Tx *postgres.Tx
}

QCalls gets all the calls that were made to Q. Check the length with:

len(mockedVinylDS.QCalls())

func (*VinylDSMock) StartTransaction

func (mock *VinylDSMock) StartTransaction() (*postgres.Tx, error)

StartTransaction calls StartTransactionFunc.

func (*VinylDSMock) StartTransactionCalls

func (mock *VinylDSMock) StartTransactionCalls() []struct {
}

StartTransactionCalls gets all the calls that were made to StartTransaction. Check the length with:

len(mockedVinylDS.StartTransactionCalls())

func (*VinylDSMock) UpdateSKU

func (mock *VinylDSMock) UpdateSKU(tx *postgres.Tx, sku *SKU) error

UpdateSKU calls UpdateSKUFunc.

func (*VinylDSMock) UpdateSKUCalls

func (mock *VinylDSMock) UpdateSKUCalls() []struct {
	Tx  *postgres.Tx
	Sku *SKU
}

UpdateSKUCalls gets all the calls that were made to UpdateSKU. Check the length with:

len(mockedVinylDS.UpdateSKUCalls())

func (*VinylDSMock) UpsertRelease

func (mock *VinylDSMock) UpsertRelease(tx *postgres.Tx, artistId int64, title string) (int64, error)

UpsertRelease calls UpsertReleaseFunc.

func (*VinylDSMock) UpsertReleaseCalls

func (mock *VinylDSMock) UpsertReleaseCalls() []struct {
	Tx       *postgres.Tx
	ArtistId int64
	Title    string
}

UpsertReleaseCalls gets all the calls that were made to UpsertRelease. Check the length with:

len(mockedVinylDS.UpsertReleaseCalls())

func (*VinylDSMock) UpsertSKU

func (mock *VinylDSMock) UpsertSKU(tx *postgres.Tx, sku *SKU) (bool, error)

UpsertSKU calls UpsertSKUFunc.

func (*VinylDSMock) UpsertSKUCalls

func (mock *VinylDSMock) UpsertSKUCalls() []struct {
	Tx  *postgres.Tx
	Sku *SKU
}

UpsertSKUCalls gets all the calls that were made to UpsertSKU. Check the length with:

len(mockedVinylDS.UpsertSKUCalls())

func (*VinylDSMock) VerifySchema

func (mock *VinylDSMock) VerifySchema() error

VerifySchema calls VerifySchemaFunc.

func (*VinylDSMock) VerifySchemaCalls

func (mock *VinylDSMock) VerifySchemaCalls() []struct {
}

VerifySchemaCalls gets all the calls that were made to VerifySchema. Check the length with:

len(mockedVinylDS.VerifySchemaCalls())

func (*VinylDSMock) WaitForDbUp

func (mock *VinylDSMock) WaitForDbUp(timeoutSecs int64) error

WaitForDbUp calls WaitForDbUpFunc.

func (*VinylDSMock) WaitForDbUpCalls

func (mock *VinylDSMock) WaitForDbUpCalls() []struct {
	TimeoutSecs int64
}

WaitForDbUpCalls gets all the calls that were made to WaitForDbUp. Check the length with:

len(mockedVinylDS.WaitForDbUpCalls())

type WatchedArtist

type WatchedArtist struct {
	ArtistID       int64    `db:"artist_id" json:"artistId"`
	ArtistName     string   `db:"artist_name" json:"artistName"`
	ArtistVariants []string `db:"artist_variants" json:"artistVariants"`
	UserID         int64    `db:"user_id" json:"userId"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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