db

package
v0.0.0-...-5782500 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// GetTaskDriver returns the TaskDriver instance with the given ID. If
	// the Task Driver does not exist, returns nil with no error.
	GetTaskDriver(context.Context, string) (*TaskDriverRun, error)

	// UpdateTaskDriver updates the Task Driver with the given ID from the
	// given Message. If no TaskDriver with the given ID exists, the DB will
	// create and insert one. The DB implementation is responsible for
	// handling thread safety, as messages may arrive simultaneously.
	UpdateTaskDriver(context.Context, string, *td.Message) error

	// Close closes the DB.
	Close() error
}

DB is an interface used for storing information about Task Drivers.

type Step

type Step struct {
	Properties *td.StepProperties `json:"properties"`
	Data       []*StepData        `json:"data"`
	Started    time.Time          `json:"started"`
	Finished   time.Time          `json:"finished"`
	Result     td.StepResult      `json:"result"`
	Errors     []string           `json:"errors"`
}

Step represents one step in a single run of a Task Driver.

func (*Step) Copy

func (s *Step) Copy() *Step

Copy returns a deep copy of the Step.

type StepData

type StepData struct {
	Type      td.DataType `json:"type"`
	Data      interface{} `json:"data"`
	Timestamp time.Time   `json:"timestamp"`
}

StepData represents data attached to a step.

type StepDataSlice

type StepDataSlice []*StepData

StepDataSlice is a slice of StepData.

func (StepDataSlice) Len

func (s StepDataSlice) Len() int

func (StepDataSlice) Less

func (s StepDataSlice) Less(i, j int) bool

func (StepDataSlice) Swap

func (s StepDataSlice) Swap(i, j int)

type TaskDriverRun

type TaskDriverRun struct {
	TaskId     string
	Properties *td.RunProperties
	Steps      map[string]*Step
}

TaskDriverRun represents a single run of a Task Driver.

func (*TaskDriverRun) Copy

func (t *TaskDriverRun) Copy() *TaskDriverRun

Copy returns a deep copy of the TaskDriverRun.

func (*TaskDriverRun) UpdateFromMessage

func (t *TaskDriverRun) UpdateFromMessage(m *td.Message) error

UpdateFromMessage updates a TaskDriverRun from the given Message. This is NOT thread-safe, so DB implementations will need to serialize calls to UpdateFromMessage for a given TaskDriverRun.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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