memory

package
v0.0.0-...-aac4589 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New create a new Memory events storage backend

Types

type Memory

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

Memory implements a storage engine which stores everything in memory. This storage engine is very inefficient and should be used only for testing purposes.

func (*Memory) Close

func (m *Memory) Close() error

Close flushes pending events and closes the database connection.

func (*Memory) GetFrameworkEvent

func (m *Memory) GetFrameworkEvent(_ xcontext.Context, eventQuery *frameworkevent.Query) ([]frameworkevent.Event, error)

GetFrameworkEvent retrieves a framework event from storage

func (*Memory) GetJobReport

func (m *Memory) GetJobReport(ctx xcontext.Context, jobID types.JobID) (*job.JobReport, error)

GetJobReport returns the report associated to a given job

func (*Memory) GetJobRequest

func (m *Memory) GetJobRequest(_ xcontext.Context, jobID types.JobID) (*job.Request, error)

GetJobRequest retrieves a job request from the in memory list

func (*Memory) GetTestEvents

func (m *Memory) GetTestEvents(_ xcontext.Context, eventQuery *testevent.Query) ([]testevent.Event, error)

GetTestEvents returns all test events that match the given query.

func (*Memory) ListJobs

func (m *Memory) ListJobs(_ xcontext.Context, query *storage.JobQuery) ([]types.JobID, error)

func (*Memory) Reset

func (m *Memory) Reset() error

Reset restores the original state of the memory storage layer

func (*Memory) StoreFrameworkEvent

func (m *Memory) StoreFrameworkEvent(_ xcontext.Context, event frameworkevent.Event) error

StoreFrameworkEvent stores a framework event into the database

func (*Memory) StoreJobRequest

func (m *Memory) StoreJobRequest(_ xcontext.Context, request *job.Request) (types.JobID, error)

StoreJobRequest stores a new job request

func (*Memory) StoreReport

func (m *Memory) StoreReport(_ xcontext.Context, report *job.Report) error

StoreReport stores a report associated to a job. Returns an error if there is already a report associated with this run.

func (*Memory) StoreTestEvent

func (m *Memory) StoreTestEvent(_ xcontext.Context, event testevent.Event) error

StoreTestEvent stores a test event into the database

func (*Memory) Version

func (m *Memory) Version() (uint64, error)

Version returns the version of the memory storage layer.

Jump to

Keyboard shortcuts

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