Documentation ¶
Index ¶
- Constants
- Variables
- func AllZero(s []byte) bool
- func CeilTimeUpToMicroseconds(timeToCeil time.Time) time.Time
- func ConcatByteSlices(a []byte, b []byte) []byte
- func FastCopy(dst io.Writer, src io.Reader) (int64, error)
- func GetFileExtension(filePath string) string
- func GetSubdirectoryRelativePath(subdirectoryPath string, directoryPath string) string
- func IsInDirectory(path, directoryPath string) bool
- func LoggedClose(c io.Closer, errmsg string)
- func LoggedSync(file *os.File, errmsg string)
- func MarshalEnumToString(enum fmt.Stringer) ([]byte, error)
- func Max(a, b int) int
- func Min(a, b int) int
- func NormalizePath(path string) string
- func ParseUntilTS(untilTS string) (time.Time, error)
- func PathsEqual(path1, path2 string) bool
- func ResetTimer(t *time.Timer, d time.Duration)
- func ResolveSymlink(path string) string
- func SanitizePath(path string) string
- func ScanToMap(rows *sql.Rows, dst map[string]interface{}) error
- func SelectMatchingFiles(fileMask string, filePathsToFilter map[string]bool) (map[string]bool, error)
- func StartCommandWithStdoutPipe(cmd *exec.Cmd) (io.ReadCloser, error)
- func StartCommandWithStdoutStderr(cmd *exec.Cmd) (io.ReadCloser, *bytes.Buffer, error)
- func StripLeftmostBackupName(path string) string
- func StripPrefixName(path string) string
- func StripRightmostBackupName(path string) string
- func StripWalFileName(path string) string
- func TimeNowCrossPlatformLocal() time.Time
- func TimeNowCrossPlatformUTC() time.Time
- func ToBytes(x interface{}) []byte
- func TrimFileExtension(filePath string) string
- func TryFetchTimeRFC3999(name string) (string, bool)
- type BytesPool
- type CascadeWriteCloser
- type Empty
- type ForbiddenActionError
- type SignalHandler
Constants ¶
const ( VersionStr = "005" BaseBackupPath = "basebackups_" + VersionStr + "/" CatchupPath = "catchup_" + VersionStr + "/" WalPath = "wal_" + VersionStr + "/" BackupNamePrefix = "base_" BackupTimeFormat = "20060102T150405Z" // timestamps in that format should be lexicographically sorted // utility.SentinelSuffix is a suffix of backup finish sentinel file SentinelSuffix = "_backup_stop_sentinel.json" CompressedBlockMaxSize = 20 << 20 CopiedBlockMaxSize = CompressedBlockMaxSize MetadataFileName = "metadata.json" PathSeparator = string(os.PathSeparator) Mebibyte = 1024 * 1024 )
const CopyBytesPoolSize = 2
Variables ¶
var MaxTime time.Time
MaxTime not really the maximal value, but high enough.
var MinTime = time.Unix(0, 0)
Functions ¶
func CeilTimeUpToMicroseconds ¶
This function is needed for being cross-platform
func ConcatByteSlices ¶
func GetFileExtension ¶
func GetSubdirectoryRelativePath ¶ added in v0.2.13
func IsInDirectory ¶ added in v0.2.13
func LoggedClose ¶
func LoggedSync ¶ added in v0.2.20
func MarshalEnumToString ¶ added in v0.2.20
MarshalEnumToString is used to write the string enum representation instead of int enum value to JSON
func NormalizePath ¶ added in v0.2.13
func PathsEqual ¶ added in v0.2.13
func ResetTimer ¶ added in v0.2.15
ResetTimer safety resets timer (drains channel if required)
func ResolveSymlink ¶
utility.ResolveSymlink converts path to physical if it is symlink
func SanitizePath ¶
func SelectMatchingFiles ¶
func StartCommandWithStdoutPipe ¶ added in v0.2.17
func StartCommandWithStdoutPipe(cmd *exec.Cmd) (io.ReadCloser, error)
func StartCommandWithStdoutStderr ¶ added in v0.2.15
func StripLeftmostBackupName ¶ added in v0.2.22
func StripPrefixName ¶
func StripRightmostBackupName ¶ added in v0.2.22
func TimeNowCrossPlatformUTC ¶
func TrimFileExtension ¶
func TryFetchTimeRFC3999 ¶
Types ¶
type BytesPool ¶ added in v0.2.17
type BytesPool struct {
// contains filtered or unexported fields
}
BytesPool holds []byte.
func NewBytesPool ¶ added in v0.2.17
NewBytesPool creates new BytesPool.
type CascadeWriteCloser ¶ added in v0.2.20
type CascadeWriteCloser struct { io.WriteCloser Underlying io.Closer }
CascadeWriteCloser bundles multiple closures into one function. Calling Close() will close the main and underlying writers.
func (*CascadeWriteCloser) Close ¶ added in v0.2.20
func (cc *CascadeWriteCloser) Close() error
Close returns the first encountered error from closing main or underlying writer.
type ForbiddenActionError ¶
type ForbiddenActionError struct {
// contains filtered or unexported fields
}
func NewForbiddenActionError ¶
func NewForbiddenActionError(message string) ForbiddenActionError
func (ForbiddenActionError) Error ¶
func (err ForbiddenActionError) Error() string
type SignalHandler ¶ added in v0.2.15
type SignalHandler struct {
// contains filtered or unexported fields
}
SignalHandler defines signal handler setup & shutdown representation
func NewSignalHandler ¶ added in v0.2.15
func NewSignalHandler(ctx context.Context, cancel func(), signals []os.Signal) *SignalHandler
NewSignalHandler constructs SignalHandler and sets up signal mask
func (*SignalHandler) Close ¶ added in v0.2.15
func (sh *SignalHandler) Close() error
Close removes signal mask and call cancel func