mock

package
v0.0.0-...-60e2cca Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore struct {
	mock.Mock
}

DataStore is a mocked data storage service

func NewDataStore

func NewDataStore() *DataStore

NewDataStore initializes a DataStore mock object

func (*DataStore) GetAllJobs

func (db *DataStore) GetAllJobs(
	ctx context.Context,
	page int64,
	perPage int64,
) ([]model.Job, int64, error)

func (*DataStore) GetJobByID

func (db *DataStore) GetJobByID(ctx context.Context,
	ID string) (*model.Job, error)

GetJobByID get a job by ID

func (*DataStore) GetJobByNameAndID

func (db *DataStore) GetJobByNameAndID(ctx context.Context,
	name, ID string) (*model.Job, error)

GetJobByNameAndID get the task execution status for a job status bu Name and ID

func (*DataStore) GetWorkflowByName

func (db *DataStore) GetWorkflowByName(ctx context.Context,
	workflowName string, version string) (*model.Workflow, error)

GetWorkflowByName returns a workflow by name

func (*DataStore) GetWorkflows

func (db *DataStore) GetWorkflows(ctx context.Context) []model.Workflow

GetWorkflows returns the list of workflows

func (*DataStore) InsertWorkflows

func (db *DataStore) InsertWorkflows(ctx context.Context,
	workflows ...model.Workflow) (int, error)

InsertWorkflows inserts one or multiple workflows

func (*DataStore) LoadWorkflows

func (db *DataStore) LoadWorkflows(ctx context.Context, l *log.Logger) error

LoadWorkflows from filesystem if the workflowsPath setting is provided

func (*DataStore) Ping

func (db *DataStore) Ping(ctx context.Context) error

func (*DataStore) UpdateJobAddResult

func (db *DataStore) UpdateJobAddResult(ctx context.Context,
	job *model.Job, result *model.TaskResult) error

UpdateJobAddResult add a task execution result to a job status

func (*DataStore) UpdateJobStatus

func (db *DataStore) UpdateJobStatus(ctx context.Context, job *model.Job,
	status int32) error

UpdateJobStatus set the task execution status for a job status

func (*DataStore) UpsertJob

func (db *DataStore) UpsertJob(ctx context.Context, job *model.Job) (*model.Job, error)

UpsertJob inserts the job in the queue

Jump to

Keyboard shortcuts

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