func OptionTransactionQueueDuration(d time.Duration) Option {
	return func(cfg *config) {
		cfg.defaultQueueDuration = d
	}
}
OptionTransactionQueueDuration sets the default queue transaction
duration. Once expired, the transaction is discarded.
package manipvortex
import (
	"time"
	"go.aporeto.io/manipulate"
)
type config struct {
	upstreamManipulator   manipulate.Manipulator
	upstreamSubscriber    manipulate.Subscriber
	logfile               string
	enableLog             bool
	transactionQueue      chan *Transaction
	readConsistency       manipulate.ReadConsistency
	writeConsistency      manipulate.WriteConsistency
	defaultQueueDuration  time.Duration
	defaultPageSize       int
	prefetcher            Prefetcher
	upstreamReconciler    Reconciler
	downstreamReconciler  Reconciler
	disableUpstreamCommit bool
}
func newConfig() *config {
	return &config{
		transactionQueue:     make(chan *Transaction, 1000),
		readConsistency:      manipulate.ReadConsistencyEventual,
		writeConsistency:     manipulate.WriteConsistencyStrong,
		defaultQueueDuration: time.Second,
		defaultPageSize:      10000,
	}
}
type Option func(*config)
func OptionDefaultConsistency(read manipulate.ReadConsistency, write manipulate.WriteConsistency) Option {
	return func(cfg *config) {
		if read != manipulate.ReadConsistencyDefault {
			cfg.readConsistency = read
		}
		if write != manipulate.WriteConsistencyDefault {
			cfg.writeConsistency = write
		}
	}
}
func OptionUpstreamManipulator(manipulator manipulate.Manipulator) Option {
	return func(cfg *config) {
		cfg.upstreamManipulator = manipulator
	}
}
func OptionUpstreamSubscriber(s manipulate.Subscriber) Option {
	return func(cfg *config) {
		cfg.upstreamSubscriber = s
	}
}
func OptionTransactionLog(filename string) Option {
	return func(cfg *config) {
		cfg.logfile = filename
		cfg.enableLog = filename != ""
	}
}
func OptionTransactionQueueLength(n int) Option {
	return func(cfg *config) {
		cfg.transactionQueue = make(chan *Transaction, n)
	}
}