sync

package
v0.0.0-...-ddb491b Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(conf conf.SSOConfig) (*http.Client, error)

Create a new HTTP client with the given SSO configuration and logging for each request.

Types

type Datasource

type Datasource interface {
	// Initialize the data source, e.g. create database tables.
	Init(context.Context)
	// Download data from the data source.
	Sync(context.Context)
}

Common interface for data sources.

type Monitor

type Monitor struct {
	// A histogram to measure how long each sync run takes.
	PipelineRunTimer *prometheus.HistogramVec
	// A gauge to observe the number of objects synced.
	PipelineObjectsGauge *prometheus.GaugeVec
	// A histogram to measure how long each sync request takes.
	PipelineRequestTimer *prometheus.HistogramVec
	// A counter to observe the number of processed sync requests.
	PipelineRequestProcessedCounter *prometheus.CounterVec
}

Monitor is a collection of Prometheus metrics for the sync package.

func NewSyncMonitor

func NewSyncMonitor(registry *monitoring.Registry) Monitor

NewSyncMonitor creates a new sync monitor and registers the necessary Prometheus metrics.

type Pipeline

type Pipeline struct {
	Syncers []Datasource
}

Pipeline wrapper for all datasources.

func (*Pipeline) Init

func (p *Pipeline) Init(ctx context.Context)

Initialize all datasources.

func (*Pipeline) SyncPeriodic

func (p *Pipeline) SyncPeriodic(ctx context.Context)

Sync all datasources in parallel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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