inmemory

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryDatastore

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

func NewInMemoryDatastore

func NewInMemoryDatastore() (*InMemoryDatastore, error)

func (*InMemoryDatastore) AddEvent

func (d *InMemoryDatastore) AddEvent(ctx context.Context, jobID string, ev model.JobEvent) error

func (*InMemoryDatastore) AddJob

func (d *InMemoryDatastore) AddJob(ctx context.Context, j *model.Job) error

func (*InMemoryDatastore) AddLocalEvent

func (d *InMemoryDatastore) AddLocalEvent(ctx context.Context, jobID string, ev model.JobLocalEvent) error

func (*InMemoryDatastore) GetJob

func (d *InMemoryDatastore) GetJob(ctx context.Context, id string) (*model.Job, error)

Gets a job from the datastore.

Errors:

  • error-job-not-found -- if the job is not found

func (*InMemoryDatastore) GetJobEvents

func (d *InMemoryDatastore) GetJobEvents(ctx context.Context, id string) ([]model.JobEvent, error)

Get Job Events from a job ID

Errors:

  • error-job-not-found -- if the job is not found

func (*InMemoryDatastore) GetJobLocalEvents

func (d *InMemoryDatastore) GetJobLocalEvents(ctx context.Context, id string) ([]model.JobLocalEvent, error)

func (*InMemoryDatastore) GetJobState

func (d *InMemoryDatastore) GetJobState(ctx context.Context, jobID string) (model.JobState, error)

func (*InMemoryDatastore) GetJobs

func (d *InMemoryDatastore) GetJobs(ctx context.Context, query localdb.JobQuery) ([]*model.Job, error)

func (*InMemoryDatastore) GetJobsCount

func (d *InMemoryDatastore) GetJobsCount(ctx context.Context, query localdb.JobQuery) (int, error)

func (*InMemoryDatastore) HasLocalEvent

func (d *InMemoryDatastore) HasLocalEvent(ctx context.Context, jobID string, eventFilter localdb.LocalEventFilter) (bool, error)

func (*InMemoryDatastore) UpdateJobDeal

func (d *InMemoryDatastore) UpdateJobDeal(ctx context.Context, jobID string, deal model.Deal) error

func (*InMemoryDatastore) UpdateShardState

func (d *InMemoryDatastore) UpdateShardState(
	ctx context.Context,
	jobID, nodeID string,
	shardIndex int,
	update model.JobShardState,
) error

Jump to

Keyboard shortcuts

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