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 (*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
Click to show internal directories.
Click to hide internal directories.