worker

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package worker synchronizes data between API and DB.

It queries the API at a specified interval and merges the results into the DB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

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

Worker coordinates communication between API and DB.

func New

func New(api *client.Client, db *db.Client, cfg *config.Config, logger *log.Logger) (*Worker, error)

New creates a new Worker instance.

func (*Worker) Run

func (w *Worker) Run(interval time.Duration, stop <-chan struct{})

Run schedules a new sync job at the specified interval. It is blocking.

Jump to

Keyboard shortcuts

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