sync

package
v2.9.9 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package syncs will sync multiple stores

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *Options)

Option sets Sync Options

func Stores

func Stores(stores ...store.Store) Option

Stores sets the layers that make up the sync

func SyncInterval

func SyncInterval(d time.Duration) Option

SyncInterval sets the duration between syncs from L0 to L1

func SyncMultiplier

func SyncMultiplier(i int64) Option

SyncMultiplier sets the multiplication factor for time to wait each sync layer

type Options

type Options struct {
	// Stores represents layers in the sync in ascending order. L0, L1, L2, etc
	Stores []store.Store
	// SyncInterval is the duration between syncs from L0 to L1
	SyncInterval time.Duration
	// SyncMultiplier is the multiplication factor between each store.
	SyncMultiplier int64
}

Options represents Sync options

type Sync

type Sync interface {
	// Implements the store interface
	store.Store
	// Force a full sync
	Sync() error
}

Sync implements a sync in for stores

func NewSync

func NewSync(opts ...Option) Sync

NewSync returns a new Sync

Jump to

Keyboard shortcuts

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