taskstorage

package
v0.0.0-...-46baba5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewSqlStorage

func NewSqlStorage(db sqlstorage.Querier) *sqlStorage

Types

type MockStorage

type MockStorage struct {
	mock.Mock
}

MockStorage is an autogenerated mock type for the Storage type

func NewMockStorage

func NewMockStorage(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockStorage

NewMockStorage creates a new instance of MockStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockStorage) Delete

func (_m *MockStorage) Delete(ctx context.Context, taskID uuid.UUID) error

Delete provides a mock function with given fields: ctx, taskID

func (*MockStorage) GetByID

func (_m *MockStorage) GetByID(ctx context.Context, id uuid.UUID) (*model.Task, error)

GetByID provides a mock function with given fields: ctx, id

func (*MockStorage) GetLastRegisteredTask

func (_m *MockStorage) GetLastRegisteredTask(ctx context.Context, name string) (*model.Task, error)

GetLastRegisteredTask provides a mock function with given fields: ctx, name

func (*MockStorage) GetNext

func (_m *MockStorage) GetNext(ctx context.Context) (*model.Task, error)

GetNext provides a mock function with given fields: ctx

func (*MockStorage) Patch

func (_m *MockStorage) Patch(ctx context.Context, taskID uuid.UUID, fields map[string]interface{}) error

Patch provides a mock function with given fields: ctx, taskID, fields

func (*MockStorage) Save

func (_m *MockStorage) Save(ctx context.Context, task *model.Task) error

Save provides a mock function with given fields: ctx, task

type Storage

type Storage interface {
	Save(ctx context.Context, task *model.Task) error
	GetNext(ctx context.Context) (*model.Task, error)
	Patch(ctx context.Context, taskID uuid.UUID, fields map[string]any) error
	GetLastRegisteredTask(ctx context.Context, name string) (*model.Task, error)
	GetByID(ctx context.Context, id uuid.UUID) (*model.Task, error)
	Delete(ctx context.Context, taskID uuid.UUID) error
}

Jump to

Keyboard shortcuts

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