sync

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package sync is the entrypoint for starting an elastic clickhouse sync

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// StartTime is the time is the earliest time to start syncing data.
	StartTime time.Time

	// StopTime is the time latest time to stop syncing data. (default: time.Now())
	StopTime time.Time

	// BatchSize is the number of records to process at a time. (default: 1000)
	BatchSize int

	// TokenIDs is the list of token IDs to sync. If empty, all token IDs are synced.
	TokenIDs []string

	// Signals is the list of signals to sync. If empty, all signals are synced.
	Signals []string

	// Parallel is the number of parallel syncs to run. (default: 25)
	Parallel int
}

type Synchronizer

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

Synchronizer is the main struct for syncing data between ElasticSearch and ClickHouse

func NewSychronizer

func NewSychronizer(logger zerolog.Logger, esService *elastic.Service, chService *clickhouse.Service, idGetter idResolver) (*Synchronizer, error)

func (*Synchronizer) Start

func (s *Synchronizer) Start(ctx context.Context, opts Options) error

Start begins the synchronization process from ElasticSearch to ClickHouse. It takes a context and stop time as parameters and returns an error if any.

Jump to

Keyboard shortcuts

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