util

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: BSD-3-Clause Imports: 11 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// TransferTaskMinLength is a minimum data length of a task for parallel data transfer
	TransferTaskMinLength int64 = 4 * 1024 * 1024 // 4MB
	// TransferTaskMaxNum is a maximum number of tasks for parallel data transfer
	TransferTaskMaxNum int = 4
	// TransferBlockSize is a block size of a task
	TransferBlockSize int64 = 1024 * 1024 // 1MB
)

Variables

This section is empty.

Functions

func GetBlockSizeForParallelTransfer added in v0.5.2

func GetBlockSizeForParallelTransfer(dataObjectLength int64) int64

GetBlockSizeForParallelTransfer returns the block size

func GetCorrectIRODSPath

func GetCorrectIRODSPath(p string) string

GetCorrectIRODSPath corrects the path

func GetIRODSDateTime

func GetIRODSDateTime(timestring string) (time.Time, error)

GetIRODSDateTime returns time struct from string IRODS time

func GetIRODSPathDepth added in v0.9.4

func GetIRODSPathDepth(p string) int

GetIRODSPathDepth returns depth of the path "/" returns 0 "abc" returns -1 "/abc" returns 0 "/a/b" returns 1 "/a/b/c" returns 2

func GetIRODSPathDirname

func GetIRODSPathDirname(p string) string

GetIRODSPathDirname returns the dir of the path

func GetIRODSPathFileName

func GetIRODSPathFileName(p string) string

GetIRODSPathFileName returns the filename of the path

func GetIRODSZone

func GetIRODSZone(p string) (string, error)

GetIRODSZone returns the zone of the path

func GetNumTasksForParallelTransfer added in v0.5.2

func GetNumTasksForParallelTransfer(dataObjectLength int64) int

GetNumTasksForParallelTransfer returns the number transfer tasks to be used

func GetParentIRODSDirs added in v0.9.4

func GetParentIRODSDirs(p string) []string

GetParentDirs returns all parent dirs

func GetRelativeIRODSPath added in v0.9.4

func GetRelativeIRODSPath(base string, target string) (string, error)

GetRelativePath returns relative path

func MakeIRODSPath

func MakeIRODSPath(collectionPath string, dataobjectName string) string

MakeIRODSPath makes the path from collection and data object

func ReadBytes

func ReadBytes(socket net.Conn, buffer []byte, size int) (int, error)

ReadBytes reads data from socket in a particular size

func Scramble added in v0.4.4

func Scramble(in, key string) string

Scramble implements the obfEncodeByKey irods cpp function.

func SplitIRODSPath

func SplitIRODSPath(p string) (string, string)

SplitIRODSPath splits the path into dir and file

func WaitTimeout added in v0.9.3

func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool

WaitTimeout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out.

func WriteBytes

func WriteBytes(socket net.Conn, buffer []byte, size int) error

WriteBytes writes data to socket

Types

This section is empty.

Jump to

Keyboard shortcuts

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