postgres

package
v0.0.0-...-f54f16c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayMigrationDriver

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

ArrayMigrationDriver implement the migratesource.Driver interface so that we can use the migrate library without files on disk.

func (*ArrayMigrationDriver) Close

func (a *ArrayMigrationDriver) Close() error

func (*ArrayMigrationDriver) First

func (a *ArrayMigrationDriver) First() (uint, error)

func (*ArrayMigrationDriver) Next

func (a *ArrayMigrationDriver) Next(version uint) (uint, error)

func (*ArrayMigrationDriver) Open

func (*ArrayMigrationDriver) Prev

func (a *ArrayMigrationDriver) Prev(version uint) (uint, error)

func (*ArrayMigrationDriver) ReadDown

func (a *ArrayMigrationDriver) ReadDown(version uint) (io.ReadCloser, string, error)

func (*ArrayMigrationDriver) ReadUp

func (a *ArrayMigrationDriver) ReadUp(version uint) (io.ReadCloser, string, error)

type PostgresBackend

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

func NewPostgresBackend

func NewPostgresBackend(connURI string, opts ...PostgresBackendOpt) *PostgresBackend

func (*PostgresBackend) CancelWorkflow

func (pg *PostgresBackend) CancelWorkflow(ctx context.Context, instanceName string, workflowName string) error

func (*PostgresBackend) Close

func (pg *PostgresBackend) Close() error

func (*PostgresBackend) CreateWorkflowSchedule

func (pg *PostgresBackend) CreateWorkflowSchedule(ctx context.Context, instanceName string, workflowName string,
	parameters []byte, enabled bool, recurrence string, nextRunAt time.Time) error

func (*PostgresBackend) DequeueTask

func (pg *PostgresBackend) DequeueTask(ctx context.Context, taskName string) (*cereal.TaskData, cereal.TaskCompleter, error)

func (*PostgresBackend) DequeueWorkflow

func (pg *PostgresBackend) DequeueWorkflow(ctx context.Context, workflowNames []string) (*cereal.WorkflowEvent, cereal.WorkflowCompleter, error)

func (*PostgresBackend) EnqueueWorkflow

func (pg *PostgresBackend) EnqueueWorkflow(ctx context.Context, w *cereal.WorkflowInstanceData) error

func (*PostgresBackend) GetDueScheduledWorkflow

func (pg *PostgresBackend) GetDueScheduledWorkflow(ctx context.Context) (*cereal.Schedule, cereal.ScheduledWorkflowCompleter, error)

func (*PostgresBackend) GetNextScheduledWorkflow

func (pg *PostgresBackend) GetNextScheduledWorkflow(ctx context.Context) (*cereal.Schedule, error)

func (*PostgresBackend) GetWorkflowInstanceByName

func (pg *PostgresBackend) GetWorkflowInstanceByName(ctx context.Context, instanceName string, workflowName string) (*cereal.WorkflowInstanceData, error)

func (*PostgresBackend) GetWorkflowScheduleByName

func (pg *PostgresBackend) GetWorkflowScheduleByName(ctx context.Context, instanceName string, workflowName string) (*cereal.Schedule, error)

func (*PostgresBackend) Init

func (pg *PostgresBackend) Init() error

func (*PostgresBackend) KillWorkflow

func (pg *PostgresBackend) KillWorkflow(ctx context.Context, instanceName string, workflowName string) error

func (*PostgresBackend) ListWorkflowInstances

func (pg *PostgresBackend) ListWorkflowInstances(ctx context.Context, opts cereal.ListWorkflowOpts) ([]*cereal.WorkflowInstanceData, error)

func (*PostgresBackend) ListWorkflowSchedules

func (pg *PostgresBackend) ListWorkflowSchedules(ctx context.Context) ([]*cereal.Schedule, error)

func (*PostgresBackend) UpdateWorkflowScheduleByName

func (pg *PostgresBackend) UpdateWorkflowScheduleByName(
	ctx context.Context, instanceName string, workflowName string, opts cereal.WorkflowScheduleUpdateOptions) error

type PostgresBackendOpt

type PostgresBackendOpt func(*PostgresBackend)

func WithTaskPingInterval

func WithTaskPingInterval(taskPingInterval time.Duration) PostgresBackendOpt

type PostgresScheduledWorkflowCompleter

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

func (*PostgresScheduledWorkflowCompleter) Close

func (*PostgresScheduledWorkflowCompleter) DisableSchedule

func (*PostgresScheduledWorkflowCompleter) EnqueueAndUpdateScheduledWorkflow

func (c *PostgresScheduledWorkflowCompleter) EnqueueAndUpdateScheduledWorkflow(s *cereal.Schedule) error

TODO(ssd) 2019-05-14: We should probably allow bulk insertion of workflows and tasks

type PostgresTaskCompleter

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

func (*PostgresTaskCompleter) Context

func (taskc *PostgresTaskCompleter) Context() context.Context

func (*PostgresTaskCompleter) Fail

func (taskc *PostgresTaskCompleter) Fail(errMsg string) error

func (*PostgresTaskCompleter) Succeed

func (taskc *PostgresTaskCompleter) Succeed(results []byte) error

TODO(ssd) 2019-05-10: Should this and Fail also take a context from the caller? If so, we'll need to

type PostgresWorkflowCompleter

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

func (*PostgresWorkflowCompleter) Close

func (workc *PostgresWorkflowCompleter) Close() error

func (*PostgresWorkflowCompleter) Continue

func (workc *PostgresWorkflowCompleter) Continue(payload []byte) error

func (*PostgresWorkflowCompleter) Done

func (workc *PostgresWorkflowCompleter) Done(result []byte) error

func (*PostgresWorkflowCompleter) EnqueueTask

func (workc *PostgresWorkflowCompleter) EnqueueTask(task *cereal.TaskData, opts cereal.TaskEnqueueOptions) error

func (*PostgresWorkflowCompleter) Fail

func (workc *PostgresWorkflowCompleter) Fail(workflowErr error) error

Jump to

Keyboard shortcuts

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