replicator

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package replicator provides very simple replication functionality which copies most recent state version from one store to another. This can be used for example when you want to replicate state from local disk to a shared (network) disk such as AWS EFS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFromTo

func CopyFromTo(from codec.ReadOnlyStore, to codec.WriteOnlyStore) error

func ReadLatest

func ReadLatest(decoder codec.Decoder, stores ...codec.ReadOnlyStore) (store.Version, error)

ReadLatest reads latest version from replicated stores.

If latest version cannot be loaded from the first store it tries to load it from the next one.

func SetLoggerAdapter added in v0.6.1

func SetLoggerAdapter(adapter logger.Adapter)

func StartFromTo

func StartFromTo(ctx context.Context, from codec.ReadOnlyStore, to codec.WriteOnlyStore, options ...Option) error

StartFromTo replicates state asynchronously in one minute intervals

Types

type Option

type Option func(*Options) error

func Interval

func Interval(d time.Duration) Option

type Options

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

Jump to

Keyboard shortcuts

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