postgres

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchInsertOperatorTasks

func BatchInsertOperatorTasks(db *sql.DB, operatorTasks []*OperatorTask) error

func CountOperatorTasks

func CountOperatorTasks(db *sql.DB, taskID uint32) (int, error)

func QueryOperatorAddressesNoRegisteredAt

func QueryOperatorAddressesNoRegisteredAt(db *sql.DB) ([]string, error)

func QueryOperatorIDs

func QueryOperatorIDs(db *sql.DB, operatorAddresses []string) ([]uint32, error)

func UpdateOperatorRegisteredAt

func UpdateOperatorRegisteredAt(db *sql.DB, operatorAddress string, timestamp time.Time) error

func UpdateTaskResponse

func UpdateTaskResponse(db *sql.DB, taskID uint32, taskResponse, responseTaskTx string, responseTaskAt time.Time) error

func UpsertOperator

func UpsertOperator(db *sql.DB, operator *Operator) (int, error)

func UpsertTask added in v0.2.8

func UpsertTask(db *sql.DB, task *Task) error

Types

type Operator

type Operator struct {
	OperatorAddress string
	OperatorID      string
	Socket          string
	Location        string
	CPUCore         uint32
	Memory          uint32
	Status          string
}

type OperatorTask

type OperatorTask struct {
	OperatorID uint32
	TaskID     uint32
	Status     string
}

type Task

type Task struct {
	TaskID         uint32
	TaskDetail     string
	TaskResponse   string
	CreateTaskTx   string
	CreateTaskAt   time.Time
	ResponseTaskTx string
	ResponseTaskAt time.Time
}

Jump to

Keyboard shortcuts

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