package models

import "github.com/go-arrower/arrower/contexts/admin/internal/interfaces/repository/models"

Index

Types

type ArrowerGueJob

type ArrowerGueJob struct {
	JobID      string
	Priority   int16
	RunAt      pgtype.Timestamptz
	JobType    string
	Args       []byte
	ErrorCount int32
	LastError  string
	Queue      string
	CreatedAt  pgtype.Timestamptz
	UpdatedAt  pgtype.Timestamptz
}

type ArrowerGueJobsHistory

type ArrowerGueJobsHistory struct {
	JobID      string
	Priority   int16
	RunAt      pgtype.Timestamptz
	JobType    string
	Args       []byte
	Queue      string
	RunCount   int32
	RunError   string
	CreatedAt  pgtype.Timestamptz
	UpdatedAt  pgtype.Timestamptz
	Success    bool
	FinishedAt pgtype.Timestamptz
	PrunedAt   pgtype.Timestamptz
}

type ArrowerGueJobsSchedule

type ArrowerGueJobsSchedule struct {
	Queue     string
	Spec      string
	JobType   string
	Args      []byte
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type ArrowerGueJobsWorkerPool

type ArrowerGueJobsWorkerPool struct {
	ID        string
	Queue     string
	Workers   int16
	GitHash   string
	JobTypes  []string
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type GetFinishedJobsByQueueAndTypeParams

type GetFinishedJobsByQueueAndTypeParams struct {
	Queue   string
	JobType string
}

type JobHistoryPayloadSizeParams

type JobHistoryPayloadSizeParams struct {
	Queue     string
	CreatedAt pgtype.Timestamptz
}

type JobTableSizeRow

type JobTableSizeRow struct {
	Jobs    string
	History string
}

type LastHistoryPayloadsParams

type LastHistoryPayloadsParams struct {
	Queue   string
	JobType string
}

type PendingJobsParams

type PendingJobsParams struct {
	DateBin    pgtype.Interval
	FinishedAt pgtype.Timestamptz
	Limit      int32
}

type PendingJobsRow

type PendingJobsRow struct {
	T     pgtype.Timestamptz
	Count int64
}

type PruneHistoryPayloadParams

type PruneHistoryPayloadParams struct {
	Queue     string
	CreatedAt pgtype.Timestamptz
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteJob

func (q *Queries) DeleteJob(ctx context.Context, jobID string) error

func (*Queries) GetFinishedJobs

func (q *Queries) GetFinishedJobs(ctx context.Context) ([]ArrowerGueJobsHistory, error)

func (*Queries) GetFinishedJobsByQueue

func (q *Queries) GetFinishedJobsByQueue(ctx context.Context, queue string) ([]ArrowerGueJobsHistory, error)

func (*Queries) GetFinishedJobsByQueueAndType

func (q *Queries) GetFinishedJobsByQueueAndType(ctx context.Context, arg GetFinishedJobsByQueueAndTypeParams) ([]ArrowerGueJobsHistory, error)

func (*Queries) GetJobHistory

func (q *Queries) GetJobHistory(ctx context.Context, jobID string) ([]ArrowerGueJobsHistory, error)

func (*Queries) GetPendingJobs

func (q *Queries) GetPendingJobs(ctx context.Context, queue string) ([]ArrowerGueJob, error)

func (*Queries) GetQueues

func (q *Queries) GetQueues(ctx context.Context) ([]string, error)

func (*Queries) GetSchedules

func (q *Queries) GetSchedules(ctx context.Context) ([]ArrowerGueJobsSchedule, error)

func (*Queries) GetWorkerPools

func (q *Queries) GetWorkerPools(ctx context.Context) ([]ArrowerGueJobsWorkerPool, error)

func (*Queries) JobHistoryPayloadSize

func (q *Queries) JobHistoryPayloadSize(ctx context.Context, arg JobHistoryPayloadSizeParams) (interface{}, error)

func (*Queries) JobHistorySize

func (q *Queries) JobHistorySize(ctx context.Context, createdAt pgtype.Timestamptz) (interface{}, error)

func (*Queries) JobTableSize

func (q *Queries) JobTableSize(ctx context.Context) (JobTableSizeRow, error)

func (*Queries) JobTypes

func (q *Queries) JobTypes(ctx context.Context, queue string) ([]string, error)

func (*Queries) LastHistoryPayloads

func (q *Queries) LastHistoryPayloads(ctx context.Context, arg LastHistoryPayloadsParams) ([][]byte, error)

func (*Queries) PendingJobs

func (q *Queries) PendingJobs(ctx context.Context, arg PendingJobsParams) ([]PendingJobsRow, error)

func (*Queries) PruneHistory

func (q *Queries) PruneHistory(ctx context.Context, createdAt pgtype.Timestamptz) error

func (*Queries) PruneHistoryPayload

func (q *Queries) PruneHistoryPayload(ctx context.Context, arg PruneHistoryPayloadParams) error

func (*Queries) ScheduleJobs

func (q *Queries) ScheduleJobs(ctx context.Context, arg []ScheduleJobsParams) (int64, error)

func (*Queries) StatsAvgDurationOfJobs

func (q *Queries) StatsAvgDurationOfJobs(ctx context.Context, queue string) (float64, error)

func (*Queries) StatsFailedJobs

func (q *Queries) StatsFailedJobs(ctx context.Context, queue string) (int64, error)

func (*Queries) StatsPendingJobs

func (q *Queries) StatsPendingJobs(ctx context.Context, queue string) (int64, error)

func (*Queries) StatsPendingJobsPerType

func (q *Queries) StatsPendingJobsPerType(ctx context.Context, queue string) ([]StatsPendingJobsPerTypeRow, error)

func (*Queries) StatsProcessedJobs

func (q *Queries) StatsProcessedJobs(ctx context.Context, queue string) (int64, error)

func (*Queries) StatsQueueWorkerPoolSize

func (q *Queries) StatsQueueWorkerPoolSize(ctx context.Context, queue string) (int32, error)

func (*Queries) TotalFinishedJobs

func (q *Queries) TotalFinishedJobs(ctx context.Context) (int64, error)

func (*Queries) TotalFinishedJobsByQueue

func (q *Queries) TotalFinishedJobsByQueue(ctx context.Context, queue string) (int64, error)

func (*Queries) TotalFinishedJobsByQueueAndType

func (q *Queries) TotalFinishedJobsByQueueAndType(ctx context.Context, arg TotalFinishedJobsByQueueAndTypeParams) (int64, error)

func (*Queries) UpdateRunAt

func (q *Queries) UpdateRunAt(ctx context.Context, arg UpdateRunAtParams) error

func (*Queries) UpsertWorkerToPool

func (q *Queries) UpsertWorkerToPool(ctx context.Context, arg UpsertWorkerToPoolParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type ScheduleJobsParams

type ScheduleJobsParams struct {
	JobID     string
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	Queue     string
	JobType   string
	Priority  int16
	RunAt     pgtype.Timestamptz
	Args      []byte
}

type StatsPendingJobsPerTypeRow

type StatsPendingJobsPerTypeRow struct {
	JobType string
	Count   int64
}

type TotalFinishedJobsByQueueAndTypeParams

type TotalFinishedJobsByQueueAndTypeParams struct {
	Queue   string
	JobType string
}

type UpdateRunAtParams

type UpdateRunAtParams struct {
	RunAt pgtype.Timestamptz
	JobID string
}

type UpsertWorkerToPoolParams

type UpsertWorkerToPoolParams struct {
	ID        string
	Queue     string
	Workers   int16
	UpdatedAt pgtype.Timestamptz
}

Source Files

copyfrom.go db.go models.go query.sql.go

Version
v0.0.0-20250311203644-ab26c1152cb4 (latest)
Published
Mar 11, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
18 minutes ago

Tools for package owners.