Documentation
¶
Index ¶
- func GetChecksumString(checksum []byte) string
- func GetIRODSZone(p string) (string, error)
- func GetParentDirs(p string) []string
- func GetPathDepth(p string) int
- func GetRelativePath(p1 string, p2 string) (string, error)
- func GetSHA1Sum(str string) string
- func MakeTimeToString(t time.Time) string
- func ParseTime(t string) (time.Time, error)
- func StackTraceFromPanic(logger *log.Entry)
- type FileBlockHelper
- func (helper *FileBlockHelper) GetBlockIDForOffset(offset int64) int64
- func (helper *FileBlockHelper) GetBlockIDs(offset int64, length int) []int64
- func (helper *FileBlockHelper) GetBlockRange(offset int64, length int, blockID int64) (int64, int)
- func (helper *FileBlockHelper) GetBlockSize() int
- func (helper *FileBlockHelper) GetBlockStartOffset(blockID int64) int64
- func (helper *FileBlockHelper) GetFirstAndLastBlockID(offset int64, length int) (int64, int64)
- func (helper *FileBlockHelper) GetLastBlockID(size int64) int64
- func (helper *FileBlockHelper) IsAlignedToBlockStart(offset int64) bool
- func (helper *FileBlockHelper) Max(val1 int64, val2 int64) int64
- func (helper *FileBlockHelper) Min(val1 int64, val2 int64) int64
- type TimeoutWaitGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChecksumString ¶
GetChecksumString returns string from checksum bytes
func GetIRODSZone ¶
GetIRODSZone returns the zone of the iRODS path
func GetPathDepth ¶
GetPathDepth returns depth of the path "/" returns 0 "abc" returns -1 "/abc" returns 0 "/a/b" returns 1 "/a/b/c" returns 2
func GetRelativePath ¶
GetRelativePath returns relative path
func MakeTimeToString ¶
MakeTimeToString returns text represented time from time.Time
func StackTraceFromPanic ¶
Types ¶
type FileBlockHelper ¶
type FileBlockHelper struct {
// contains filtered or unexported fields
}
FileBlockHelper helps block/offset related calculation
func NewFileBlockHelper ¶
func NewFileBlockHelper(blockSize int) *FileBlockHelper
func (*FileBlockHelper) GetBlockIDForOffset ¶
func (helper *FileBlockHelper) GetBlockIDForOffset(offset int64) int64
GetBlockIDForOffset returns block index
func (*FileBlockHelper) GetBlockIDs ¶
func (helper *FileBlockHelper) GetBlockIDs(offset int64, length int) []int64
GetBlockIDs returns all block ids
func (*FileBlockHelper) GetBlockRange ¶
GetBlockRange returns offset and length for given block, within given offset and length
func (*FileBlockHelper) GetBlockSize ¶
func (helper *FileBlockHelper) GetBlockSize() int
GetBlockSize returns block size
func (*FileBlockHelper) GetBlockStartOffset ¶
func (helper *FileBlockHelper) GetBlockStartOffset(blockID int64) int64
GetBlockStartOffset returns block start offset
func (*FileBlockHelper) GetFirstAndLastBlockID ¶
func (helper *FileBlockHelper) GetFirstAndLastBlockID(offset int64, length int) (int64, int64)
GetFirstAndLastBlockID returns first and last block id
func (*FileBlockHelper) GetLastBlockID ¶
func (helper *FileBlockHelper) GetLastBlockID(size int64) int64
GetLastBlockID returns the last block of the file
func (*FileBlockHelper) IsAlignedToBlockStart ¶
func (helper *FileBlockHelper) IsAlignedToBlockStart(offset int64) bool
IsAligned checks if offset is aligned to block start
type TimeoutWaitGroup ¶
type TimeoutWaitGroup struct {
// contains filtered or unexported fields
}
func NewTimeoutWaitGroup ¶
func NewTimeoutWaitGroup() *TimeoutWaitGroup
func (*TimeoutWaitGroup) Add ¶
func (wg *TimeoutWaitGroup) Add(delta int)
func (*TimeoutWaitGroup) Done ¶
func (wg *TimeoutWaitGroup) Done()
func (*TimeoutWaitGroup) Wait ¶
func (wg *TimeoutWaitGroup) Wait()
func (*TimeoutWaitGroup) WaitTimeout ¶
func (wg *TimeoutWaitGroup) WaitTimeout(timeout time.Duration) bool