datahistoryjobresult

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBService

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

DBService is a service which allows the interaction with the database without a direct reference to a global

func Setup

func Setup(db database.IDatabase) (*DBService, error)

Setup returns a DBService

func (*DBService) GetByJobID

func (db *DBService) GetByJobID(jobID string) ([]DataHistoryJobResult, error)

GetByJobID returns a job by its related JobID

func (*DBService) GetJobResultsBetween

func (db *DBService) GetJobResultsBetween(jobID string, startDate, endDate time.Time) ([]DataHistoryJobResult, error)

GetJobResultsBetween will return all jobs between two dates

func (*DBService) Upsert

func (db *DBService) Upsert(jobs ...*DataHistoryJobResult) error

Upsert inserts or updates jobs into the database

type DataHistoryJobResult

type DataHistoryJobResult struct {
	ID                string
	JobID             string
	IntervalStartDate time.Time
	IntervalEndDate   time.Time
	Status            int64
	Result            string
	Date              time.Time
}

DataHistoryJobResult is a DTO for database data

type IDBService

type IDBService interface {
	Upsert(jobs ...*DataHistoryJobResult) error
	GetByJobID(jobID string) ([]DataHistoryJobResult, error)
	GetJobResultsBetween(jobID string, startDate, endDate time.Time) ([]DataHistoryJobResult, error)
}

IDBService allows using data history job result database service without needing to care about implementation

Jump to

Keyboard shortcuts

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