postgres

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgreSQL

type PostgreSQL struct {
	DB *sql.DB
}

func New

func New(dsn string, options *relational.DBOptions) *PostgreSQL

New initializes and returns a PostgreSQL client.

func (*PostgreSQL) CheckHealth

func (psql *PostgreSQL) CheckHealth() bool

CheckHealth returns the status of MySQL.

func (*PostgreSQL) Close

func (psql *PostgreSQL) Close() error

Close terminates any storage connections gracefully.

func (*PostgreSQL) CreateJob

func (psql *PostgreSQL) CreateJob(j *domain.Job) error

CreateJob adds a new job to the repository.

func (*PostgreSQL) CreateJobResult

func (psql *PostgreSQL) CreateJobResult(result *domain.JobResult) error

CreateJobResult adds new job result to the repository.

func (*PostgreSQL) DeleteJob

func (psql *PostgreSQL) DeleteJob(id string) error

DeleteJob deletes a job from the repository.

func (*PostgreSQL) DeleteJobResult

func (psql *PostgreSQL) DeleteJobResult(jobID string) error

DeleteJobResult deletes a job result from the repository.

func (*PostgreSQL) GetDueJobs

func (psql *PostgreSQL) GetDueJobs() ([]*domain.Job, error)

GetDueJobs fetches all jobs scheduled to run before now and have not been scheduled yet.

func (*PostgreSQL) GetJob

func (psql *PostgreSQL) GetJob(id string) (*domain.Job, error)

GetJob fetches a job from the repository.

func (*PostgreSQL) GetJobResult

func (psql *PostgreSQL) GetJobResult(jobID string) (*domain.JobResult, error)

GetJobResult fetches a job result from the repository.

func (*PostgreSQL) GetJobs

func (psql *PostgreSQL) GetJobs(status domain.JobStatus) ([]*domain.Job, error)

GetJobs fetches all jobs from the repository, optionally filters the jobs by status.

func (*PostgreSQL) UpdateJob

func (psql *PostgreSQL) UpdateJob(id string, j *domain.Job) error

UpdateJob updates a job to the repository.

func (*PostgreSQL) UpdateJobResult

func (psql *PostgreSQL) UpdateJobResult(jobID string, result *domain.JobResult) error

UpdateJobResult updates a job result to the repository.

Jump to

Keyboard shortcuts

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