dal

package
v0.359.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAL

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

func New

func New(conn sql.ConnI) *DAL

func (*DAL) Begin added in v0.359.0

func (d *DAL) Begin(ctx context.Context) (*Tx, error)

func (*DAL) CreateAsyncCall added in v0.359.0

func (d *DAL) CreateAsyncCall(ctx context.Context, params sql.CreateAsyncCallParams) (int64, error)

CreateAsyncCall creates an async_call row and returns its id

func (*DAL) GetCronJobByKey added in v0.359.0

func (d *DAL) GetCronJobByKey(ctx context.Context, key model.CronJobKey) (model.CronJob, error)

GetCronJobByKey returns a cron_job row by its key

func (*DAL) GetUnscheduledCronJobs added in v0.359.0

func (d *DAL) GetUnscheduledCronJobs(ctx context.Context, startTime time.Time) ([]model.CronJob, error)

GetUnscheduledCronJobs returns all cron_jobs rows with start_time before provided startTime for deployments with min replicas > 0 with no pending corresponding async_calls after last_execution

func (*DAL) IsCronJobPending added in v0.359.0

func (d *DAL) IsCronJobPending(ctx context.Context, key model.CronJobKey, startTime time.Time) (bool, error)

IsCronJobPending returns whether this cron job is executing or scheduled in async_calls

func (*DAL) UpdateCronJobExecution added in v0.359.0

func (d *DAL) UpdateCronJobExecution(ctx context.Context, params sql.UpdateCronJobExecutionParams) error

UpdateCronJobExecution updates the last_async_call_id, last_execution, and next_execution of the cron job given by the provided key

type Tx added in v0.359.0

type Tx struct {
	*DAL
}

func (*Tx) Commit added in v0.359.0

func (t *Tx) Commit(ctx context.Context) error

func (*Tx) CommitOrRollback added in v0.359.0

func (t *Tx) CommitOrRollback(ctx context.Context, err *error)

func (*Tx) Rollback added in v0.359.0

func (t *Tx) Rollback(ctx context.Context) error

Jump to

Keyboard shortcuts

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