Documentation ¶
Index ¶
- type DBService
- func (db *DBService) GetAllIncompleteJobsAndResults() ([]DataHistoryJob, error)
- func (db *DBService) GetByID(id string) (*DataHistoryJob, error)
- func (db *DBService) GetByNickName(nickname string) (*DataHistoryJob, error)
- func (db *DBService) GetJobAndAllResults(nickname string) (*DataHistoryJob, error)
- func (db *DBService) GetJobsBetween(startDate, endDate time.Time) ([]DataHistoryJob, error)
- func (db *DBService) Upsert(jobs ...*DataHistoryJob) error
- type DataHistoryJob
- type IDBService
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) GetAllIncompleteJobsAndResults ¶
func (db *DBService) GetAllIncompleteJobsAndResults() ([]DataHistoryJob, error)
GetAllIncompleteJobsAndResults returns all jobs that have the status "active"
func (*DBService) GetByID ¶
func (db *DBService) GetByID(id string) (*DataHistoryJob, error)
GetByID returns a job by its id
func (*DBService) GetByNickName ¶
func (db *DBService) GetByNickName(nickname string) (*DataHistoryJob, error)
GetByNickName returns a job by its nickname
func (*DBService) GetJobAndAllResults ¶
func (db *DBService) GetJobAndAllResults(nickname string) (*DataHistoryJob, error)
GetJobAndAllResults returns a job and joins all job results
func (*DBService) GetJobsBetween ¶
func (db *DBService) GetJobsBetween(startDate, endDate time.Time) ([]DataHistoryJob, error)
GetJobsBetween will return all jobs between two dates
func (*DBService) Upsert ¶
func (db *DBService) Upsert(jobs ...*DataHistoryJob) error
Upsert inserts or updates jobs into the database
type DataHistoryJob ¶
type DataHistoryJob struct { ID string Nickname string ExchangeID string ExchangeName string Asset string Base string Quote string StartDate time.Time EndDate time.Time Interval int64 RequestSizeLimit int64 DataType int64 MaxRetryAttempts int64 BatchSize int64 Status int64 CreatedDate time.Time Results []*datahistoryjobresult.DataHistoryJobResult }
DataHistoryJob is a DTO for database data
type IDBService ¶
type IDBService interface { Upsert(jobs ...*DataHistoryJob) error GetByNickName(nickname string) (*DataHistoryJob, error) GetByID(id string) (*DataHistoryJob, error) GetJobsBetween(startDate, endDate time.Time) ([]DataHistoryJob, error) GetAllIncompleteJobsAndResults() ([]DataHistoryJob, error) GetJobAndAllResults(nickname string) (*DataHistoryJob, error) }
IDBService allows using data history job database service without needing to care about implementation
Click to show internal directories.
Click to hide internal directories.