func ReadConsistentDisable() ReadOption {
	return func(opts *ReadOptions) {
		opts.consistent = false
	}
}
ReadConsistentDisable disable consistent reads
package dynalock
import (
	"encoding/base64"
	"time"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/dynamodb"
)
type WriteOption func(opts *WriteOptions)
type WriteOptions struct {
	value    *dynamodb.AttributeValue
	ttl      time.Duration
	previous *KVPair  
}
func NewWriteOptions(opts ...WriteOption) *WriteOptions {
	writeOpts := &WriteOptions{
		ttl: noTTLSet,
	}
	for _, opt := range opts {
		opt(writeOpts)
	}
	if writeOpts.ttl == noTTLSet {
		writeOpts.ttl = DefaultLockTTL
	}
	return writeOpts
}
func WriteWithTTL(ttl time.Duration) WriteOption {
	return func(opts *WriteOptions) {
		opts.ttl = ttl
	}
}
func WriteWithNoExpires() WriteOption {
	return func(opts *WriteOptions) {
		opts.ttl = 0
	}
}
func WriteWithBytes(val []byte) WriteOption {
	return func(opts *WriteOptions) {
		opts.value = encodePayload(val)
	}
}
func WriteWithAttributeValue(av *dynamodb.AttributeValue) WriteOption {
	return func(opts *WriteOptions) {
		opts.value = av
	}
}
func WriteWithPreviousKV(previous *KVPair) WriteOption {
	return func(opts *WriteOptions) {
		opts.previous = previous
		if opts.previous != nil {
			opts.ttl = time.Until(time.Unix(opts.previous.Expires, 0))  
		}
	}
}
type ReadOption func(opts *ReadOptions)
type ReadOptions struct {
	consistent bool
}
func NewReadOptions(opts ...ReadOption) *ReadOptions {
	readOpts := &ReadOptions{
		consistent: true,
	}
	for _, opt := range opts {
		opt(readOpts)
	}
	return readOpts
}