database

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDBClient

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

BoltDBClient is a wrapper around bbolt.DB for job persistence.

func NewDB

func NewDB(path string) (*BoltDBClient, error)

NewDB opens a BoltDB database and initializes the necessary buckets.

func (*BoltDBClient) AcquireLock

func (c *BoltDBClient) AcquireLock(jobID, instanceID string) (bool, error)

AcquireLock attempts to acquire a lock for a job.

func (*BoltDBClient) Close

func (c *BoltDBClient) Close() error

Close closes the BoltDB database.

func (*BoltDBClient) GetJob

func (c *BoltDBClient) GetJob(id string) (*types.Job, error)

GetJob retrieves a job from the BoltDB database.

func (*BoltDBClient) LoadJobs

func (c *BoltDBClient) LoadJobs() ([]types.Job, error)

LoadJobs loads all jobs from the BoltDB database.

func (*BoltDBClient) ReleaseLock

func (c *BoltDBClient) ReleaseLock(jobID, instanceID string) error

ReleaseLock releases a lock for a job.

func (*BoltDBClient) SaveJob

func (c *BoltDBClient) SaveJob(job *types.Job) error

SaveJob saves a job to the BoltDB database.

Jump to

Keyboard shortcuts

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