Documentation
¶
Index ¶
- type BoltDBClient
- func (c *BoltDBClient) AcquireLock(jobID, instanceID string) (bool, error)
- func (c *BoltDBClient) Close() error
- func (c *BoltDBClient) GetJob(id string) (*types.Job, error)
- func (c *BoltDBClient) LoadJobs() ([]types.Job, error)
- func (c *BoltDBClient) ReleaseLock(jobID, instanceID string) error
- func (c *BoltDBClient) SaveJob(job *types.Job) error
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) 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.
Click to show internal directories.
Click to hide internal directories.