postgres

package
v0.1.72 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTaskLogsRetentionPeriod = time.Hour * 24 * 7
)

Functions

This section is empty.

Types

type Option

type Option = func(ds *PostgresDatastore)

func WithDisableCleanup

func WithDisableCleanup(val bool) Option

func WithTaskLogRetentionPeriod

func WithTaskLogRetentionPeriod(dur time.Duration) Option

type PostgresDatastore

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

func NewPostgresDataStore

func NewPostgresDataStore(dsn string, opts ...Option) (*PostgresDatastore, error)

func (*PostgresDatastore) CreateJob

func (ds *PostgresDatastore) CreateJob(ctx context.Context, j *tork.Job) error

func (*PostgresDatastore) CreateNode

func (ds *PostgresDatastore) CreateNode(ctx context.Context, n *tork.Node) error

func (*PostgresDatastore) CreateTask

func (ds *PostgresDatastore) CreateTask(ctx context.Context, t *tork.Task) error

func (*PostgresDatastore) CreateTaskLogPart

func (ds *PostgresDatastore) CreateTaskLogPart(ctx context.Context, p *tork.TaskLogPart) error

func (*PostgresDatastore) ExecScript

func (ds *PostgresDatastore) ExecScript(script string) error

func (*PostgresDatastore) GetActiveNodes

func (ds *PostgresDatastore) GetActiveNodes(ctx context.Context) ([]*tork.Node, error)

func (*PostgresDatastore) GetActiveTasks

func (ds *PostgresDatastore) GetActiveTasks(ctx context.Context, jobID string) ([]*tork.Task, error)

func (*PostgresDatastore) GetJobByID

func (ds *PostgresDatastore) GetJobByID(ctx context.Context, id string) (*tork.Job, error)

func (*PostgresDatastore) GetJobLogParts added in v0.1.70

func (ds *PostgresDatastore) GetJobLogParts(ctx context.Context, jobID string, page, size int) (*datastore.Page[*tork.TaskLogPart], error)

func (*PostgresDatastore) GetJobs

func (ds *PostgresDatastore) GetJobs(ctx context.Context, q string, page, size int) (*datastore.Page[*tork.JobSummary], error)

func (*PostgresDatastore) GetMetrics

func (ds *PostgresDatastore) GetMetrics(ctx context.Context) (*tork.Metrics, error)

func (*PostgresDatastore) GetNodeByID

func (ds *PostgresDatastore) GetNodeByID(ctx context.Context, id string) (*tork.Node, error)

func (*PostgresDatastore) GetTaskByID

func (ds *PostgresDatastore) GetTaskByID(ctx context.Context, id string) (*tork.Task, error)

func (*PostgresDatastore) GetTaskLogParts

func (ds *PostgresDatastore) GetTaskLogParts(ctx context.Context, taskID string, page, size int) (*datastore.Page[*tork.TaskLogPart], error)

func (*PostgresDatastore) HealthCheck

func (ds *PostgresDatastore) HealthCheck(ctx context.Context) error

func (*PostgresDatastore) UpdateJob

func (ds *PostgresDatastore) UpdateJob(ctx context.Context, id string, modify func(u *tork.Job) error) error

func (*PostgresDatastore) UpdateNode

func (ds *PostgresDatastore) UpdateNode(ctx context.Context, id string, modify func(u *tork.Node) error) error

func (*PostgresDatastore) UpdateTask

func (ds *PostgresDatastore) UpdateTask(ctx context.Context, id string, modify func(t *tork.Task) error) error

func (*PostgresDatastore) WithTx

func (ds *PostgresDatastore) WithTx(ctx context.Context, f func(tx datastore.Datastore) error) error

Jump to

Keyboard shortcuts

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