db

package
v0.0.0-...-be868c5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApproveTaskParams

type ApproveTaskParams struct {
	WorkflowID uuid.UUID
	Name       string
	ApprovedAt sql.NullTime
}

type CreateScheduleParams

type CreateScheduleParams struct {
	WorkflowName    string
	WorkflowParams  sql.NullString
	Spec            string
	Once            time.Time
	IntervalMinutes int32
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type CreateTaskLogParams

type CreateTaskLogParams struct {
	WorkflowID uuid.UUID
	TaskName   string
	Body       string
}

type CreateTaskParams

type CreateTaskParams struct {
	WorkflowID       uuid.UUID
	Name             string
	Finished         bool
	Result           sql.NullString
	Error            sql.NullString
	CreatedAt        time.Time
	UpdatedAt        time.Time
	ApprovedAt       sql.NullTime
	ReadyForApproval bool
}

type CreateWorkflowParams

type CreateWorkflowParams struct {
	ID         uuid.UUID
	Params     sql.NullString
	Name       sql.NullString
	ScheduleID sql.NullInt32
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

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
}

type FailUnfinishedTasksParams

type FailUnfinishedTasksParams struct {
	WorkflowID uuid.UUID
	UpdatedAt  time.Time
}

type PGDBTX

type PGDBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	BeginFunc(ctx context.Context, f func(pgx.Tx) error) error
	Close()
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ApproveTask

func (q *Queries) ApproveTask(ctx context.Context, arg ApproveTaskParams) (Task, error)

func (*Queries) ClearWorkflowSchedule

func (q *Queries) ClearWorkflowSchedule(ctx context.Context, dollar_1 int32) ([]uuid.UUID, error)

func (*Queries) CreateSchedule

func (q *Queries) CreateSchedule(ctx context.Context, arg CreateScheduleParams) (Schedule, error)

func (*Queries) CreateTask

func (q *Queries) CreateTask(ctx context.Context, arg CreateTaskParams) (Task, error)

func (*Queries) CreateTaskLog

func (q *Queries) CreateTaskLog(ctx context.Context, arg CreateTaskLogParams) (TaskLog, error)

func (*Queries) CreateWorkflow

func (q *Queries) CreateWorkflow(ctx context.Context, arg CreateWorkflowParams) (Workflow, error)

func (*Queries) DeleteSchedule

func (q *Queries) DeleteSchedule(ctx context.Context, id int32) (Schedule, error)

func (*Queries) FailUnfinishedTasks

func (q *Queries) FailUnfinishedTasks(ctx context.Context, arg FailUnfinishedTasksParams) error

func (*Queries) Schedules

func (q *Queries) Schedules(ctx context.Context) ([]Schedule, error)

func (*Queries) SchedulesLastRun

func (q *Queries) SchedulesLastRun(ctx context.Context) ([]SchedulesLastRunRow, error)

func (*Queries) Task

func (q *Queries) Task(ctx context.Context, arg TaskParams) (Task, error)

func (*Queries) TaskLogs

func (q *Queries) TaskLogs(ctx context.Context) ([]TaskLog, error)

func (*Queries) TaskLogsForTask

func (q *Queries) TaskLogsForTask(ctx context.Context, arg TaskLogsForTaskParams) ([]TaskLog, error)

func (*Queries) TaskLogsForWorkflow

func (q *Queries) TaskLogsForWorkflow(ctx context.Context, workflowID uuid.UUID) ([]TaskLog, error)

func (*Queries) Tasks

func (q *Queries) Tasks(ctx context.Context) ([]TasksRow, error)

func (*Queries) TasksForWorkflow

func (q *Queries) TasksForWorkflow(ctx context.Context, workflowID uuid.UUID) ([]Task, error)

func (*Queries) TasksForWorkflowSorted

func (q *Queries) TasksForWorkflowSorted(ctx context.Context, workflowID uuid.UUID) ([]TasksForWorkflowSortedRow, error)

func (*Queries) UnfinishedWorkflows

func (q *Queries) UnfinishedWorkflows(ctx context.Context) ([]Workflow, error)

func (*Queries) UpdateTaskReadyForApproval

func (q *Queries) UpdateTaskReadyForApproval(ctx context.Context, arg UpdateTaskReadyForApprovalParams) (Task, error)

func (*Queries) UpsertTask

func (q *Queries) UpsertTask(ctx context.Context, arg UpsertTaskParams) (Task, error)

func (*Queries) WithTx

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

func (*Queries) Workflow

func (q *Queries) Workflow(ctx context.Context, id uuid.UUID) (Workflow, error)

func (*Queries) WorkflowCount

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

func (*Queries) WorkflowFinished

func (q *Queries) WorkflowFinished(ctx context.Context, arg WorkflowFinishedParams) (Workflow, error)

func (*Queries) WorkflowNames

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

func (*Queries) WorkflowSidebar

func (q *Queries) WorkflowSidebar(ctx context.Context) ([]WorkflowSidebarRow, error)

func (*Queries) Workflows

func (q *Queries) Workflows(ctx context.Context) ([]Workflow, error)

Copyright 2021 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

func (*Queries) WorkflowsByName

func (q *Queries) WorkflowsByName(ctx context.Context, name sql.NullString) ([]Workflow, error)

func (*Queries) WorkflowsByNames

func (q *Queries) WorkflowsByNames(ctx context.Context, names []string) ([]Workflow, error)

type Schedule

type Schedule struct {
	ID              int32
	WorkflowName    string
	WorkflowParams  sql.NullString
	Spec            string
	Once            time.Time
	IntervalMinutes int32
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type SchedulesLastRunRow

type SchedulesLastRunRow struct {
	ID                int32
	WorkflowID        uuid.UUID
	WorkflowCreatedAt sql.NullTime
	WorkflowError     sql.NullString
	WorkflowFinished  sql.NullBool
}

type Task

type Task struct {
	WorkflowID       uuid.UUID
	Name             string
	Finished         bool
	Result           sql.NullString
	Error            sql.NullString
	CreatedAt        time.Time
	UpdatedAt        time.Time
	ApprovedAt       sql.NullTime
	ReadyForApproval bool
	Started          bool
	RetryCount       int32
}

type TaskLog

type TaskLog struct {
	ID         int32
	WorkflowID uuid.UUID
	TaskName   string
	Body       string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type TaskLogsForTaskParams

type TaskLogsForTaskParams struct {
	WorkflowID uuid.UUID
	TaskName   string
}

type TaskParams

type TaskParams struct {
	WorkflowID uuid.UUID
	Name       string
}

type TasksForWorkflowSortedRow

type TasksForWorkflowSortedRow struct {
	WorkflowID       uuid.UUID
	Name             string
	Finished         bool
	Result           sql.NullString
	Error            sql.NullString
	CreatedAt        time.Time
	UpdatedAt        time.Time
	ApprovedAt       sql.NullTime
	ReadyForApproval bool
	Started          bool
	RetryCount       int32
	MostRecentUpdate time.Time
}

type TasksRow

type TasksRow struct {
	WorkflowID       uuid.UUID
	Name             string
	Finished         bool
	Result           sql.NullString
	Error            sql.NullString
	CreatedAt        time.Time
	UpdatedAt        time.Time
	ApprovedAt       sql.NullTime
	ReadyForApproval bool
	Started          bool
	RetryCount       int32
	MostRecentUpdate time.Time
}

type UpdateTaskReadyForApprovalParams

type UpdateTaskReadyForApprovalParams struct {
	WorkflowID       uuid.UUID
	Name             string
	ReadyForApproval bool
}

type UpsertTaskParams

type UpsertTaskParams struct {
	WorkflowID uuid.UUID
	Name       string
	Started    bool
	Finished   bool
	Result     sql.NullString
	Error      sql.NullString
	CreatedAt  time.Time
	UpdatedAt  time.Time
	RetryCount int32
}

type Workflow

type Workflow struct {
	ID         uuid.UUID
	Params     sql.NullString
	Name       sql.NullString
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Finished   bool
	Output     string
	Error      string
	ScheduleID sql.NullInt32
}

type WorkflowFinishedParams

type WorkflowFinishedParams struct {
	ID        uuid.UUID
	Finished  bool
	Output    string
	Error     string
	UpdatedAt time.Time
}

type WorkflowSidebarRow

type WorkflowSidebarRow struct {
	Name  sql.NullString
	Count int64
}

Jump to

Keyboard shortcuts

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