utility

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionStr       = "005"
	BaseBackupPath   = "basebackups_" + VersionStr + "/"
	WalPath          = "wal_" + VersionStr + "/"
	BackupNamePrefix = "base_"

	// 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)
)

Variables

This section is empty.

Functions

func AllZero

func AllZero(s []byte) bool

func CeilTimeUpToMicroseconds

func CeilTimeUpToMicroseconds(timeToCeil time.Time) time.Time

This function is needed for being cross-platform

func ConcatByteSlices

func ConcatByteSlices(a []byte, b []byte) []byte

func FastCopy

func FastCopy(dst io.Writer, src io.Reader) (int64, error)

FastCopy copies data from src to dst in blocks of CopiedBlockMaxSize bytes

func GetFileExtension

func GetFileExtension(filePath string) string

func GetSubdirectoryRelativePath added in v0.2.13

func GetSubdirectoryRelativePath(subdirectoryPath string, directoryPath string) string

func IsInDirectory added in v0.2.13

func IsInDirectory(path, directoryPath string) bool

func LoggedClose

func LoggedClose(c io.Closer, errmsg string)

TODO : unit tests

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func NormalizePath added in v0.2.13

func NormalizePath(path string) string

func PathsEqual added in v0.2.13

func PathsEqual(path1, path2 string) bool
func ResolveSymlink(path string) string

utility.ResolveSymlink converts path to physical if it is symlink

func SanitizePath

func SanitizePath(path string) string

func SelectMatchingFiles

func SelectMatchingFiles(fileMask string, filePathsToFilter map[string]bool) (map[string]bool, error)

func StripBackupName

func StripBackupName(path string) string

func StripPrefixName

func StripPrefixName(path string) string

func StripWalFileName

func StripWalFileName(path string) string

Strips the backup WAL file name.

func TimeNowCrossPlatformLocal

func TimeNowCrossPlatformLocal() time.Time

func TimeNowCrossPlatformUTC

func TimeNowCrossPlatformUTC() time.Time

func ToBytes

func ToBytes(x interface{}) []byte

func TrimFileExtension

func TrimFileExtension(filePath string) string

TODO : unit tests

func TryFetchTimeRFC3999

func TryFetchTimeRFC3999(name string) (string, bool)

TODO : unit tests

Types

type Empty

type Empty struct{}

Empty is used for channel signaling.

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

Jump to

Keyboard shortcuts

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