Documentation ¶
Overview ¶
Package pg implements backend.Interface using Postgres.
Index ¶
- Variables
- type Config
- type Postgres
- func (pg *Postgres) AckJobs(ctx context.Context, results *resource.Acks) error
- func (pg *Postgres) BlockQueues(ctx context.Context, queues []string) error
- func (pg *Postgres) Close() error
- func (pg *Postgres) DeleteJobKeys(ctx context.Context, keys []string) error
- func (pg *Postgres) DeleteJobUniqueArgs(ctx context.Context, ids, keys []string) error
- func (pg *Postgres) DeleteQueues(ctx context.Context, queues []string) error
- func (pg *Postgres) DequeueJobs(ctx context.Context, limit int, opts *resource.JobListParams) (*resource.Jobs, error)
- func (pg *Postgres) EnqueueJobs(ctx context.Context, jobs *resource.Jobs) (*resource.Jobs, error)
- func (pg *Postgres) GetJobByID(ctx context.Context, id string, opts *resource.GetByIDOpts) (*resource.Job, error)
- func (pg *Postgres) GetJobUniqueArgs(ctx context.Context, keys []string) ([]string, bool, error)
- func (pg *Postgres) GetQueue(ctx context.Context, name string, opts *resource.GetByIDOpts) (*resource.Queue, error)
- func (pg *Postgres) Handler() http.Handler
- func (pg *Postgres) InvalidateJobs(ctx context.Context) error
- func (pg *Postgres) ListJobs(ctx context.Context, limit int, opts *resource.JobListParams) (*resource.Jobs, error)
- func (pg *Postgres) ListQueues(ctx context.Context, opts *resource.QueueListParams) (*resource.Queues, error)
- func (pg *Postgres) Middleware() func(next http.Handler) http.Handler
- func (pg *Postgres) PauseQueues(ctx context.Context, queues []string) error
- func (pg *Postgres) Ping(ctx context.Context) error
- func (pg *Postgres) Reap(ctx context.Context, cfg *backend.ReaperConfig) error
- func (pg *Postgres) Reset(ctx context.Context) error
- func (pg *Postgres) SaveQueue(ctx context.Context, queue *resource.Queue) (*resource.Queue, error)
- func (pg *Postgres) SetJobUniqueArgs(ctx context.Context, ids, keys []string) error
- func (pg *Postgres) Stats(ctx context.Context, queue string) (*resource.Stats, error)
- func (pg *Postgres) UnblockQueues(ctx context.Context, queues []string) error
- func (pg *Postgres) UnpauseQueues(ctx context.Context, queues []string) error
- type ProviderFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Config: backend.DefaultConfig, Database: "job_manager", }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { backend.Config Database string `json:"database" envconfig:"postgres_database"` Host string `json:"host,omitempty" envconfig:"postgres_host"` Port int `json:"port,omitempty" envconfig:"postgres_port"` User string `json:"user,omitempty" envconfig:"postgres_user"` Password string `json:"password,omitempty" envconfig:"postgres_pass"` SSLMode string `json:"sslmode,omitempty" envconfig:"postgres_sslmode"` }
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func New ¶
func New(providers ...ProviderFunc) *Postgres
New returns a new instance of a postgresql backend.
example dsn: user=jack password=secret host=pg.example.com port=5432 dbname=mydb sslmode=verify-ca
func (*Postgres) BlockQueues ¶ added in v0.4.0
func (*Postgres) DeleteJobKeys ¶
func (*Postgres) DeleteJobUniqueArgs ¶
func (*Postgres) DeleteQueues ¶ added in v0.4.0
func (*Postgres) DequeueJobs ¶
func (*Postgres) EnqueueJobs ¶
func (*Postgres) GetJobByID ¶
func (*Postgres) GetJobUniqueArgs ¶
func (*Postgres) ListQueues ¶
func (*Postgres) Middleware ¶
Middleware provides transaction middleware.
func (*Postgres) PauseQueues ¶ added in v0.4.0
func (*Postgres) SetJobUniqueArgs ¶
func (*Postgres) UnblockQueues ¶ added in v0.4.0
type ProviderFunc ¶
func WithConfig ¶
func WithConfig(cfg Config) ProviderFunc
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package migrations contains migration data.
|
Package migrations contains migration data. |
Click to show internal directories.
Click to hide internal directories.