rdbms

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: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FrameworkEventEmitTime

func FrameworkEventEmitTime(ev frameworkevent.Event) interface{}

FrameworkEventEmitTime returns the emission timestamp from a events.FrameworkEvent object

func FrameworkEventJobID

func FrameworkEventJobID(ev frameworkevent.Event) interface{}

FrameworkEventJobID returns the JobID from a events.TestEvent object

func FrameworkEventName

func FrameworkEventName(ev frameworkevent.Event) interface{}

FrameworkEventName returns the name for the FrameworkEvent object

func FrameworkEventPayload

func FrameworkEventPayload(ev frameworkevent.Event) interface{}

FrameworkEventPayload returns the payload from a events.FrameworkEvent object

func New

func New(dbURI string, opts ...Opt) (storage.Storage, error)

New creates a RDBMS events storage backend with default parameters

func TestEventEmitTime

func TestEventEmitTime(ev testevent.Event) interface{}

TestEventEmitTime returns the emission timestamp from an events.TestEvent object

func TestEventJobID

func TestEventJobID(ev testevent.Event) interface{}

TestEventJobID returns the JobID from an events.TestEvent object

func TestEventName

func TestEventName(ev testevent.Event) interface{}

TestEventName returns the event name from an events.TestEvent object

func TestEventPayload

func TestEventPayload(ev testevent.Event) interface{}

TestEventPayload returns the payload from an events.TestEvent object

func TestEventRunID

func TestEventRunID(ev testevent.Event) interface{}

TestEventRunID returns the RunID from a

func TestEventTargetID

func TestEventTargetID(ev testevent.Event) interface{}

TestEventTargetID returns the target id from an events.TestEvent object

func TestEventTestName

func TestEventTestName(ev testevent.Event) interface{}

TestEventTestName returns the test name from an events.TestEvent object

func TestEventTestStepLabel

func TestEventTestStepLabel(ev testevent.Event) interface{}

TestEventTestStepLabel returns the test step label from an events.TestEvent object

Types

type FrameworkEventField

type FrameworkEventField func(ev frameworkevent.Event) interface{}

FrameworkEventField is a function type which retrieves information from a FrameworkEvent object

type Opt

type Opt func(rdbms *RDBMS)

Opt is a function type that sets parameters on the RDBMS object

func DriverName

func DriverName(name string) Opt

DriverName allows using a mysql-compatible driver (e.g. a wrapper around mysql or a syntax-compatible variant).

func FrameworkEventsFlushInterval

func FrameworkEventsFlushInterval(flushInterval time.Duration) Opt

FrameworkEventsFlushInterval defines the interval at which buffered framework events are stored into the database

func FrameworkEventsFlushSize

func FrameworkEventsFlushSize(flushSize int) Opt

FrameworkEventsFlushSize defines maximum size of the framework events buffer after which events are flushed to the database.

func TestEventsFlushInterval

func TestEventsFlushInterval(flushInterval time.Duration) Opt

TestEventsFlushInterval defines the interval at which buffered test events are stored into the database

func TestEventsFlushSize

func TestEventsFlushSize(flushSize int) Opt

TestEventsFlushSize defines maximum size of the test events buffer after which events are flushed to the database.

type RDBMS

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

RDBMS implements a storage engine which stores ConTest information in a relational database via the database/sql package. With the current implementation, only MySQL is officially supported. Within MySQL, the current limitations are the following:

It's not possible to use prepared statements. Not all MySQL connectors implementing database/sql support prepared statements, so the plugin cannot depend on them.

func (*RDBMS) BeginTx

func (r *RDBMS) BeginTx() (storage.TransactionalStorage, error)

BeginTx returns a storage.TransactionalStorage object backed by a transactional db object

func (*RDBMS) Close

func (r *RDBMS) Close() error

Close flushes pending events and closes the database connection.

func (*RDBMS) Commit

func (r *RDBMS) Commit() error

Commit persists the current transaction, if there is one active

func (*RDBMS) GetFrameworkEvent

func (r *RDBMS) GetFrameworkEvent(ctx xcontext.Context, eventQuery *frameworkevent.Query) ([]frameworkevent.Event, error)

GetFrameworkEvent retrieves framework events matching the query fields provided

func (*RDBMS) GetJobReport

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

GetJobReport retrieves a JobReport from the database

func (*RDBMS) GetJobRequest

func (r *RDBMS) GetJobRequest(ctx xcontext.Context, jobID types.JobID) (*job.Request, error)

GetJobRequest retrieves a JobRequest from the database

func (*RDBMS) GetTestEvents

func (r *RDBMS) GetTestEvents(ctx xcontext.Context, eventQuery *testevent.Query) ([]testevent.Event, error)

GetTestEvents retrieves test events matching the query fields provided

func (*RDBMS) ListJobs

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

func (*RDBMS) Reset

func (r *RDBMS) Reset() error

Reset wipes entire database contents. Used in tests.

func (*RDBMS) Rollback

func (r *RDBMS) Rollback() error

Rollback rolls back the current transaction, if there is one active

func (*RDBMS) StoreFrameworkEvent

func (r *RDBMS) StoreFrameworkEvent(ctx xcontext.Context, event frameworkevent.Event) error

StoreFrameworkEvent appends an event to the internal buffer and triggers a flush when the internal storage utilization goes beyond `frameworkEventsFlushSize`

func (*RDBMS) StoreJobRequest

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

StoreJobRequest stores a new job request in the database

func (*RDBMS) StoreReport

func (r *RDBMS) StoreReport(_ xcontext.Context, report *job.Report) error

StoreReport persists a run or final report in the internal storage.

func (*RDBMS) StoreTestEvent

func (r *RDBMS) StoreTestEvent(_ xcontext.Context, event testevent.Event) error

StoreTestEvent appends an event to the internal buffer and triggers a flush when the internal storage utilization goes beyond `testEventsFlushSize`

func (*RDBMS) Version

func (r *RDBMS) Version() (uint64, error)

Version returns the current version of the RDBMS schema

type TestEventField

type TestEventField func(ev testevent.Event) interface{}

TestEventField is a function type which retrieves information from a TestEvent object.

Jump to

Keyboard shortcuts

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