util

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: BSD-3-Clause Imports: 9 Imported by: 4

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 GetDirname added in v0.6.1

func GetDirname(p string) string

GetDirname returns the dir of the path

func GetFileName added in v0.6.1

func GetFileName(p string) string

GetFileName returns the filename of the path

func GetIRODSDateTime

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

GetIRODSDateTime returns time struct from string IRODS time

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 GetParentDirs added in v0.6.1

func GetParentDirs(p string) []string

GetParentDirs returns all parent dirs

func GetPathDepth added in v0.6.1

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 added in v0.6.1

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

GetRelativePath returns relative path

func IsAbsolutePath added in v0.6.1

func IsAbsolutePath(p string) bool

IsAbsolutePath returns true if the path is absolute

func JoinPath added in v0.6.1

func JoinPath(dirPath string, filePath string) string

JoinPath makes the path from dir and file paths

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 SplitPath added in v0.6.1

func SplitPath(p string) (string, string)

SplitPath splits the path into dir and file

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