utils

package
v0.0.0-...-e88642b Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: BSD-3-Clause Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChecksumString

func GetChecksumString(checksum []byte) string

GetChecksumString returns string from checksum bytes

func GetIRODSZone

func GetIRODSZone(p string) (string, error)

GetIRODSZone returns the zone of the iRODS path

func GetParentDirs

func GetParentDirs(p string) []string

GetParentDirs returns all parent dirs

func GetPathDepth

func GetPathDepth(p string) int

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

func GetRelativePath(p1 string, p2 string) (string, error)

GetRelativePath returns relative path

func GetSHA1Sum

func GetSHA1Sum(str string) string

GetSHA1Sum returns sha1 check sum string

func MakeTimeToString

func MakeTimeToString(t time.Time) string

MakeTimeToString returns text represented time from time.Time

func ParseTime

func ParseTime(t string) (time.Time, error)

ParseTime returns time.Time from text represented time

func StackTraceFromPanic

func StackTraceFromPanic(logger *log.Entry)

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

func (helper *FileBlockHelper) GetBlockRange(offset int64, length int, blockID int64) (int64, int)

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

func (*FileBlockHelper) Max

func (helper *FileBlockHelper) Max(val1 int64, val2 int64) int64

Max returns max value between val1 and val2

func (*FileBlockHelper) Min

func (helper *FileBlockHelper) Min(val1 int64, val2 int64) int64

Min returns min value between val1 and val2

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

Jump to

Keyboard shortcuts

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