Documentation
¶
Index ¶
- type Database
- func (db Database) CheckHealth(ctx context.Context) error
- func (db Database) CreateJob(ctx context.Context, job *api.Job) (*api.Job, error)
- func (db Database) CreateWorkflow(ctx context.Context, workflow *api.Workflow) (*api.Workflow, error)
- func (db Database) DeleteJob(ctx context.Context, jobID string) error
- func (db Database) DeleteWorkflow(ctx context.Context, name string) error
- func (db Database) GetJob(ctx context.Context, jobID string, fetchParams persistence.FetchParams) (*api.Job, error)
- func (db Database) GetWorkflow(ctx context.Context, name string) (*api.Workflow, error)
- func (db Database) QueryJobs(ctx context.Context, filterParams persistence.FilterParams, ...) (*api.PaginatedJobList, error)
- func (db Database) QueryWorkflows(ctx context.Context, sortParams persistence.SortParams, ...) (*api.PaginatedWorkflowList, error)
- func (db Database) Shutdown()
- func (db Database) UpdateJob(ctx context.Context, job *api.Job, request persistence.JobUpdate) (*api.Job, error)
- type MySQL
- type PostgreSQL
- type SQLite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database manages access to a SQLite database. It implements the wfx persistence interface. It holds a pointer to the connection and is safe to copy by value.
func (Database) CreateWorkflow ¶
func (db Database) CreateWorkflow(ctx context.Context, workflow *api.Workflow) (*api.Workflow, error)
CreateWorkflow creates a new workflow.
func (Database) DeleteWorkflow ¶
DeleteWorkflow deletes an existing workflow.
func (Database) GetJob ¶
func (db Database) GetJob(ctx context.Context, jobID string, fetchParams persistence.FetchParams) (*api.Job, error)
func (Database) GetWorkflow ¶
func (Database) QueryJobs ¶
func (db Database) QueryJobs(ctx context.Context, filterParams persistence.FilterParams, sortParams persistence.SortParams, paginationParams persistence.PaginationParams, ) (*api.PaginatedJobList, error)
QueryJobs returns the jobs matching filterParams.
func (Database) QueryWorkflows ¶
func (db Database) QueryWorkflows(ctx context.Context, sortParams persistence.SortParams, paginationParams persistence.PaginationParams) (*api.PaginatedWorkflowList, error)
QueryWorkflows returns multiple workflows (paginated).
type MySQL ¶ added in v0.4.0
type MySQL struct {
Database
}
func (*MySQL) Initialize ¶ added in v0.4.0
type PostgreSQL ¶ added in v0.4.0
type PostgreSQL struct {
Database
}
func (*PostgreSQL) Initialize ¶ added in v0.4.0
func (wrapper *PostgreSQL) Initialize(options string) error
Initialize sets up the PostgreSQL database connection using the provided DSN (options), runs migrations, and initializes the ent client.
Parameters:
- options: PostgreSQL connection string (DSN) in the format: "user=<username> password=<password> host=localhost port=5432 database=wfx sslmode=disable" See https://github.com/jackc/pgx/blob/master/stdlib/sql.go for DSN syntax details.
Click to show internal directories.
Click to hide internal directories.