db

package
v0.0.0-...-8939947 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package db is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when the requested item could not be found.

Functions

This section is empty.

Types

type DB

type DB interface {
	Init(ctx context.Context) error

	AddTest(ctx context.Context, test *tester.Test) error
	GetTest(ctx context.Context, id uuid.UUID) (*tester.Test, error)
	ListTests(ctx context.Context, limit int) ([]*tester.Test, error)
	ListTestsForPackage(ctx context.Context, pkg string, limit int) ([]*tester.Test, error)
	ListTestsForPackageInRange(ctx context.Context, pkg string, begin, end time.Time) ([]*tester.Test, error)

	EnqueueRun(ctx context.Context, run *tester.Run) error
	StartRun(ctx context.Context, id uuid.UUID, runner string) error
	ResetRun(ctx context.Context, id uuid.UUID) error
	DeleteRun(ctx context.Context, id uuid.UUID) error
	CompleteRun(ctx context.Context, id uuid.UUID) error
	FailRun(ctx context.Context, id uuid.UUID, error string) error
	GetRun(ctx context.Context, id uuid.UUID) (*tester.Run, error)
	ListPendingRuns(ctx context.Context) ([]*tester.Run, error)
	ListFinishedRuns(ctx context.Context, limit int) ([]*tester.Run, error)
	ListRunsForPackage(ctx context.Context, pkg string, limit int) ([]*tester.Run, error)
	ListRunSummariesInRange(ctx context.Context, begin, end time.Time, window time.Duration) ([]*tester.RunSummary, error)
}

DB is the interface for a persistence store implementation.

type MockDB

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

MockDB is a mock of DB interface

func NewMockDB

func NewMockDB(ctrl *gomock.Controller) *MockDB

NewMockDB creates a new mock instance

func (*MockDB) AddTest

func (m *MockDB) AddTest(arg0 context.Context, arg1 *tester.Test) error

AddTest mocks base method

func (*MockDB) CompleteRun

func (m *MockDB) CompleteRun(arg0 context.Context, arg1 uuid.UUID) error

CompleteRun mocks base method

func (*MockDB) DeleteRun

func (m *MockDB) DeleteRun(arg0 context.Context, arg1 uuid.UUID) error

DeleteRun mocks base method

func (*MockDB) EXPECT

func (m *MockDB) EXPECT() *MockDBMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockDB) EnqueueRun

func (m *MockDB) EnqueueRun(arg0 context.Context, arg1 *tester.Run) error

EnqueueRun mocks base method

func (*MockDB) FailRun

func (m *MockDB) FailRun(arg0 context.Context, arg1 uuid.UUID, arg2 string) error

FailRun mocks base method

func (*MockDB) GetRun

func (m *MockDB) GetRun(arg0 context.Context, arg1 uuid.UUID) (*tester.Run, error)

GetRun mocks base method

func (*MockDB) GetTest

func (m *MockDB) GetTest(arg0 context.Context, arg1 uuid.UUID) (*tester.Test, error)

GetTest mocks base method

func (*MockDB) Init

func (m *MockDB) Init(arg0 context.Context) error

Init mocks base method

func (*MockDB) ListFinishedRuns

func (m *MockDB) ListFinishedRuns(arg0 context.Context, arg1 int) ([]*tester.Run, error)

ListFinishedRuns mocks base method

func (*MockDB) ListPendingRuns

func (m *MockDB) ListPendingRuns(arg0 context.Context) ([]*tester.Run, error)

ListPendingRuns mocks base method

func (*MockDB) ListRunSummariesInRange

func (m *MockDB) ListRunSummariesInRange(arg0 context.Context, arg1, arg2 time.Time, arg3 time.Duration) ([]*tester.RunSummary, error)

ListRunSummariesInRange mocks base method

func (*MockDB) ListRunsForPackage

func (m *MockDB) ListRunsForPackage(arg0 context.Context, arg1 string, arg2 int) ([]*tester.Run, error)

ListRunsForPackage mocks base method

func (*MockDB) ListTests

func (m *MockDB) ListTests(arg0 context.Context, arg1 int) ([]*tester.Test, error)

ListTests mocks base method

func (*MockDB) ListTestsForPackage

func (m *MockDB) ListTestsForPackage(arg0 context.Context, arg1 string, arg2 int) ([]*tester.Test, error)

ListTestsForPackage mocks base method

func (*MockDB) ListTestsForPackageInRange

func (m *MockDB) ListTestsForPackageInRange(arg0 context.Context, arg1 string, arg2, arg3 time.Time) ([]*tester.Test, error)

ListTestsForPackageInRange mocks base method

func (*MockDB) ResetRun

func (m *MockDB) ResetRun(arg0 context.Context, arg1 uuid.UUID) error

ResetRun mocks base method

func (*MockDB) StartRun

func (m *MockDB) StartRun(arg0 context.Context, arg1 uuid.UUID, arg2 string) error

StartRun mocks base method

type MockDBMockRecorder

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

MockDBMockRecorder is the mock recorder for MockDB

func (*MockDBMockRecorder) AddTest

func (mr *MockDBMockRecorder) AddTest(arg0, arg1 interface{}) *gomock.Call

AddTest indicates an expected call of AddTest

func (*MockDBMockRecorder) CompleteRun

func (mr *MockDBMockRecorder) CompleteRun(arg0, arg1 interface{}) *gomock.Call

CompleteRun indicates an expected call of CompleteRun

func (*MockDBMockRecorder) DeleteRun

func (mr *MockDBMockRecorder) DeleteRun(arg0, arg1 interface{}) *gomock.Call

DeleteRun indicates an expected call of DeleteRun

func (*MockDBMockRecorder) EnqueueRun

func (mr *MockDBMockRecorder) EnqueueRun(arg0, arg1 interface{}) *gomock.Call

EnqueueRun indicates an expected call of EnqueueRun

func (*MockDBMockRecorder) FailRun

func (mr *MockDBMockRecorder) FailRun(arg0, arg1, arg2 interface{}) *gomock.Call

FailRun indicates an expected call of FailRun

func (*MockDBMockRecorder) GetRun

func (mr *MockDBMockRecorder) GetRun(arg0, arg1 interface{}) *gomock.Call

GetRun indicates an expected call of GetRun

func (*MockDBMockRecorder) GetTest

func (mr *MockDBMockRecorder) GetTest(arg0, arg1 interface{}) *gomock.Call

GetTest indicates an expected call of GetTest

func (*MockDBMockRecorder) Init

func (mr *MockDBMockRecorder) Init(arg0 interface{}) *gomock.Call

Init indicates an expected call of Init

func (*MockDBMockRecorder) ListFinishedRuns

func (mr *MockDBMockRecorder) ListFinishedRuns(arg0, arg1 interface{}) *gomock.Call

ListFinishedRuns indicates an expected call of ListFinishedRuns

func (*MockDBMockRecorder) ListPendingRuns

func (mr *MockDBMockRecorder) ListPendingRuns(arg0 interface{}) *gomock.Call

ListPendingRuns indicates an expected call of ListPendingRuns

func (*MockDBMockRecorder) ListRunSummariesInRange

func (mr *MockDBMockRecorder) ListRunSummariesInRange(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

ListRunSummariesInRange indicates an expected call of ListRunSummariesInRange

func (*MockDBMockRecorder) ListRunsForPackage

func (mr *MockDBMockRecorder) ListRunsForPackage(arg0, arg1, arg2 interface{}) *gomock.Call

ListRunsForPackage indicates an expected call of ListRunsForPackage

func (*MockDBMockRecorder) ListTests

func (mr *MockDBMockRecorder) ListTests(arg0, arg1 interface{}) *gomock.Call

ListTests indicates an expected call of ListTests

func (*MockDBMockRecorder) ListTestsForPackage

func (mr *MockDBMockRecorder) ListTestsForPackage(arg0, arg1, arg2 interface{}) *gomock.Call

ListTestsForPackage indicates an expected call of ListTestsForPackage

func (*MockDBMockRecorder) ListTestsForPackageInRange

func (mr *MockDBMockRecorder) ListTestsForPackageInRange(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

ListTestsForPackageInRange indicates an expected call of ListTestsForPackageInRange

func (*MockDBMockRecorder) ResetRun

func (mr *MockDBMockRecorder) ResetRun(arg0, arg1 interface{}) *gomock.Call

ResetRun indicates an expected call of ResetRun

func (*MockDBMockRecorder) StartRun

func (mr *MockDBMockRecorder) StartRun(arg0, arg1, arg2 interface{}) *gomock.Call

StartRun indicates an expected call of StartRun

type PG

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

func NewPG

func NewPG(pool *pgxpool.Pool) *PG

func (*PG) AddTest

func (p *PG) AddTest(ctx context.Context, test *tester.Test) error

func (*PG) CompleteRun

func (p *PG) CompleteRun(ctx context.Context, id uuid.UUID) error

func (*PG) DeleteRun

func (p *PG) DeleteRun(ctx context.Context, id uuid.UUID) error

func (*PG) EnqueueRun

func (p *PG) EnqueueRun(ctx context.Context, run *tester.Run) error

func (*PG) FailRun

func (p *PG) FailRun(ctx context.Context, id uuid.UUID, error string) error

func (*PG) GetRun

func (p *PG) GetRun(ctx context.Context, id uuid.UUID) (*tester.Run, error)

func (*PG) GetTest

func (p *PG) GetTest(ctx context.Context, id uuid.UUID) (*tester.Test, error)

func (*PG) Init

func (p *PG) Init(ctx context.Context) error

func (*PG) ListFinishedRuns

func (p *PG) ListFinishedRuns(ctx context.Context, limit int) ([]*tester.Run, error)

func (*PG) ListPendingRuns

func (p *PG) ListPendingRuns(ctx context.Context) ([]*tester.Run, error)

func (*PG) ListRunSummariesInRange

func (p *PG) ListRunSummariesInRange(ctx context.Context, begin, end time.Time, window time.Duration) ([]*tester.RunSummary, error)

func (*PG) ListRunsForPackage

func (p *PG) ListRunsForPackage(ctx context.Context, pkg string, limit int) ([]*tester.Run, error)

func (*PG) ListTests

func (p *PG) ListTests(ctx context.Context, limit int) ([]*tester.Test, error)

func (*PG) ListTestsForPackage

func (p *PG) ListTestsForPackage(ctx context.Context, pkg string, limit int) ([]*tester.Test, error)

func (*PG) ListTestsForPackageInRange

func (p *PG) ListTestsForPackageInRange(ctx context.Context, pkg string, from, to time.Time) ([]*tester.Test, error)

func (*PG) ListTestsInDateRange

func (p *PG) ListTestsInDateRange(ctx context.Context, from, to time.Time) ([]*tester.Test, error)

func (*PG) ResetRun

func (p *PG) ResetRun(ctx context.Context, id uuid.UUID) error

func (*PG) StartRun

func (p *PG) StartRun(ctx context.Context, id uuid.UUID, runner string) error

Jump to

Keyboard shortcuts

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