Add end-to-end replication/restore testing

This commit is contained in:
Ben Johnson
2022-01-14 15:31:04 -07:00
parent f308e0b154
commit 84d08f547a
27 changed files with 755 additions and 117 deletions

View File

@@ -1,8 +1,10 @@
package litestream
import (
"crypto/md5"
"database/sql"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"io"
@@ -43,7 +45,7 @@ var (
var (
// LogWriter is the destination writer for all logging.
LogWriter = os.Stderr
LogWriter = os.Stdout
// LogFlags are the flags passed to log.New().
LogFlags = 0
@@ -460,6 +462,12 @@ func isHexChar(ch rune) bool {
return (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f')
}
// md5hash returns a hex-encoded MD5 hash of b.
func md5hash(b []byte) string {
sum := md5.Sum(b)
return hex.EncodeToString(sum[:])
}
// Tracef is used for low-level tracing.
var Tracef = func(format string, a ...interface{}) {}