postgres

package
v0.11.9-rc.8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	scheduler.UnimplementedSchedulerServiceServer
	// contains filtered or unexported fields
}

Postgres provides a PostgreSQL database server backend.

func NewPostgres

func NewPostgres(conf *config.Postgres) (*Postgres, error)

func (*Postgres) Close

func (db *Postgres) Close()

Close closes the database session.

func (*Postgres) DeleteNode

func (db *Postgres) DeleteNode(ctx context.Context, req *scheduler.Node) (*scheduler.DeleteNodeResponse, error)

DeleteNode deletes a node

func (*Postgres) GetNode

func (db *Postgres) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)

GetNode gets a node

func (*Postgres) GetTask

func (db *Postgres) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)

GetTask gets a task.

func (*Postgres) Init

func (db *Postgres) Init() error

func (*Postgres) ListNodes

ListNodes is an API endpoint that returns a list of nodes.

func (*Postgres) ListTasks

func (db *Postgres) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)

ListTasks returns a list of tasks.

func (*Postgres) PutNode

func (db *Postgres) PutNode(ctx context.Context, node *scheduler.Node) (*scheduler.PutNodeResponse, error)

PutNode is an RPC endpoint that is used by nodes to send heartbeats and status updates.

func (*Postgres) ReadQueue

func (db *Postgres) ReadQueue(n int) []*tes.Task

ReadQueue returns a slice of queued Tasks. Up to "n" tasks are returned.

func (*Postgres) WriteEvent

func (db *Postgres) WriteEvent(ctx context.Context, req *events.Event) error

WriteEvent creates an event for the server to handle.

type TaskCore

type TaskCore struct {
	ID       string `db:"id"`
	Owner    string `db:"owner"`
	StateStr string `db:"state"`
	DataJSON []byte `db:"data"`
}

The PostgreSQL struct for minimal projection (only fields outside the JSONB blob)

Jump to

Keyboard shortcuts

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