longtailutils

package module
v0.0.0-...-be456c3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const NoCompressionType = uint32(0)

Variables

This section is empty.

Functions

func ByteCountBinary

func ByteCountBinary(b uint64) string

func ByteCountDecimal

func ByteCountDecimal(b uint64) string

func CreateProgress

func CreateProgress(task string, percentRateLimit uint32) longtaillib.Longtail_ProgressAPI

CreateProgress ...

func DeleteByURI

func DeleteByURI(uri string, opts ...longtailstorelib.BlobStoreOption) error

DeleteByURI ...

func FlushStore

func FlushStore(store *longtaillib.Longtail_BlockStoreAPI) (*flushCompletionAPI, error)

flushStore ...

func FlushStoreSync

func FlushStoreSync(store *longtaillib.Longtail_BlockStoreAPI) error

func FlushStoresSync

func FlushStoresSync(stores []longtaillib.Longtail_BlockStoreAPI) error

func GetCompressionType

func GetCompressionType(compressionAlgorithm string) (uint32, error)

func GetCompressionTypesForFiles

func GetCompressionTypesForFiles(fileInfos longtaillib.Longtail_FileInfos, compressionType uint32) []uint32

func GetDetailsString

func GetDetailsString(path string, size uint64, permissions uint16, isDir bool, sizePadding int) string

func GetExistingStoreIndexSync

func GetExistingStoreIndexSync(
	indexStore longtaillib.Longtail_BlockStoreAPI,
	chunkHashes []uint64,
	minBlockUsagePercent uint32) (longtaillib.Longtail_StoreIndex, error)

GetExistingStoreIndexSync ...

func GetFolderIndex

func GetFolderIndex(
	sourceFolderPath string,
	sourceIndexPath string,
	targetChunkSize uint32,
	compressionType uint32,
	hashIdentifier uint32,
	pathFilter longtaillib.Longtail_PathFilterAPI,
	fs longtaillib.Longtail_StorageAPI,
	jobs longtaillib.Longtail_JobAPI,
	hashRegistry longtaillib.Longtail_HashRegistryAPI,
	enableFileMapping bool,
	scanner *AsyncFolderScanner) (longtaillib.Longtail_VersionIndex, longtaillib.Longtail_HashAPI, time.Duration, error)

func GetHashIdentifier

func GetHashIdentifier(hashAlgorithm string) (uint32, error)

func HashIdentifierToString

func HashIdentifierToString(hashIdentifier uint32) string

func MakeRegexPathFilter

func MakeRegexPathFilter(includeFilterRegEx string, excludeFilterRegEx string) (longtaillib.Longtail_PathFilterAPI, error)

MakeRegexPathFilter ...

func ParseLevel

func ParseLevel(lvl string) (int, error)

func PrintStats

func PrintStats(name string, stats longtaillib.BlockStoreStats, showStats bool)

func PruneBlocksSync

func PruneBlocksSync(
	indexStore longtaillib.Longtail_BlockStoreAPI,
	keepBlockHashes []uint64) (uint32, error)

PruneBlocksSync ...

func ReadBlobWithRetry

func ReadBlobWithRetry(
	ctx context.Context,
	client longtailstorelib.BlobClient,
	key string) ([]byte, int, error)

func ReadFromURI

func ReadFromURI(uri string, opts ...longtailstorelib.BlobStoreOption) ([]byte, error)

ReadFromURI ...

func WithS3EndpointResolverURI

func WithS3EndpointResolverURI(endpointURI string) longtailstorelib.BlobStoreOption

func WriteToURI

func WriteToURI(uri string, data []byte, opts ...longtailstorelib.BlobStoreOption) error

WriteToURI ...

Types

type AssertData

type AssertData struct {
}

AssertData ...

func (*AssertData) OnAssert

func (a *AssertData) OnAssert(expression string, file string, line int)

OnAssert ...

type AsyncFolderScanner

type AsyncFolderScanner struct {
	// contains filtered or unexported fields
}

func (*AsyncFolderScanner) Get

func (*AsyncFolderScanner) Scan

type AsyncVersionIndexReader

type AsyncVersionIndexReader struct {
	// contains filtered or unexported fields
}

func (*AsyncVersionIndexReader) Get

func (*AsyncVersionIndexReader) Read

func (indexReader *AsyncVersionIndexReader) Read(
	sourceFolderPath string,
	sourceIndexPath string,
	targetChunkSize uint32,
	compressionType uint32,
	hashIdentifier uint32,
	pathFilter longtaillib.Longtail_PathFilterAPI,
	fs longtaillib.Longtail_StorageAPI,
	jobs longtaillib.Longtail_JobAPI,
	hashRegistry longtaillib.Longtail_HashRegistryAPI,
	enableFileMapping bool,
	scanner *AsyncFolderScanner)

type FileHook

type FileHook struct {
	// contains filtered or unexported fields
}

func NewFileLog

func NewFileLog(path string, formatter logrus.Formatter) (FileHook, error)

func (*FileHook) Fire

func (hook *FileHook) Fire(entry *logrus.Entry) error

func (*FileHook) Levels

func (hook *FileHook) Levels() []logrus.Level

type GetStoredBlockCompletionAPI

type GetStoredBlockCompletionAPI struct {
	Wg          sync.WaitGroup
	StoredBlock longtaillib.Longtail_StoredBlock
	Err         error
}

GetStoredBlockCompletionAPI ...

func (*GetStoredBlockCompletionAPI) OnComplete

func (a *GetStoredBlockCompletionAPI) OnComplete(storedBlock longtaillib.Longtail_StoredBlock, err error)

type LoggerData

type LoggerData struct {
}

LoggerData ...

func (*LoggerData) OnLog

func (l *LoggerData) OnLog(file string, function string, line int, level int, logFields []longtaillib.LogField, message string)

OnLog ...

type ProgressData

type ProgressData struct {
	// contains filtered or unexported fields
}

ProgressData ...

func (*ProgressData) OnProgress

func (p *ProgressData) OnProgress(totalCount uint32, doneCount uint32)

ProgressData ...

type StoreFlush

type StoreFlush struct {
	// contains filtered or unexported fields
}

func FlushStores

func FlushStores(stores []longtaillib.Longtail_BlockStoreAPI) (*StoreFlush, error)

FlushStores ...

func (*StoreFlush) Wait

func (s *StoreFlush) Wait() error

Wait

type StoreStat

type StoreStat struct {
	Name  string
	Stats longtaillib.BlockStoreStats
}

type TimeStat

type TimeStat struct {
	Name string
	Dur  time.Duration
}

Jump to

Keyboard shortcuts

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