Documentation ¶
Index ¶
- Constants
- func Decrypt(algorithm types.EncryptionAlgorithm, key []byte, iv []byte, source []byte, ...) (int, error)
- func Encrypt(algorithm types.EncryptionAlgorithm, key []byte, iv []byte, source []byte, ...) (int, error)
- func EscapeXMLSpecialChars(in string) string
- func ExistFile(path string) bool
- func ExpandHomeDir(path string) (string, error)
- func GetBasename(p string) string
- func GetBlockSizeForParallelTransfer(dataObjectLength int64) int64
- func GetCorrectIRODSPath(p string) string
- func GetCorrectLocalPath(p string) string
- func GetDir(p string) string
- func GetEncoderRing(key string) []byte
- func GetEncryptionBlockSize(algorithm types.EncryptionAlgorithm) int
- func GetEncryptionIV(algorithm types.EncryptionAlgorithm) ([]byte, error)
- func GetHashLocalFile(sourcePath string, hashAlg hash.Hash) ([]byte, error)
- func GetHashStrings(strs []string, hashAlg hash.Hash) ([]byte, error)
- func GetIRODSDateTime(timestring string) (time.Time, error)
- func GetIRODSDateTimeStringForTicket(t time.Time) string
- func GetIRODSPathDepth(p string) int
- func GetIRODSPathDirname(p string) string
- func GetIRODSPathFileName(p string) string
- func GetIRODSZone(p string) (string, error)
- func GetNumTasksForParallelTransfer(dataObjectLength int64) int
- func GetParentIRODSDirs(p string) []string
- func GetPasswordPadded(newPassword string) string
- func GetRelativeIRODSPath(base string, target string) (string, error)
- func HashLocalFile(sourcePath string, hashAlg string) ([]byte, error)
- func HashStrings(strs []string, hashAlg string) ([]byte, error)
- func Join(p1 string, p2 ...string) string
- func MakeIRODSPath(collectionPath string, dataobjectName string) string
- func MakeRandomString(size int) string
- func ObfuscateNewPassword(newPassword string, oldPassword string, signature string) string
- func ReadBytes(socket net.Conn, buffer []byte, size int) (int, error)
- func ReadBytesWithTrackerCallBack(socket net.Conn, buffer []byte, size int, callback common.TrackerCallBack) (int, error)
- func Scramble(toScramble string, key string, scramblePrefix string, blockChaining bool) string
- func ScrambleV2(newPassword string, oldPassword string, signature string) string
- func SplitIRODSPath(p string) (string, string)
- func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool
- func WriteBytes(socket net.Conn, buffer []byte, size int) error
- func WriteBytesWithTrackerCallBack(socket net.Conn, buffer []byte, size int, callback common.TrackerCallBack) error
Constants ¶
const ( // TransferTaskMinLength is a minimum data length of a task for parallel data transfer TransferTaskMinLength int64 = 32 * 1024 * 1024 // 32MB // 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 Decrypt ¶
func Decrypt(algorithm types.EncryptionAlgorithm, key []byte, iv []byte, source []byte, dest []byte) (int, error)
Decrypt decrypts data
func Encrypt ¶
func Encrypt(algorithm types.EncryptionAlgorithm, key []byte, iv []byte, source []byte, dest []byte) (int, error)
Encrypt encrypts data
func EscapeXMLSpecialChars ¶
EscapeXMLSpecialChars escape special chars for XML
func ExpandHomeDir ¶
func GetBasename ¶
func GetBlockSizeForParallelTransfer ¶
GetBlockSizeForParallelTransfer returns the block size
func GetCorrectIRODSPath ¶
GetCorrectIRODSPath corrects the path
func GetCorrectLocalPath ¶
GetCorrectLocalPath corrects the path
func GetEncryptionBlockSize ¶
func GetEncryptionBlockSize(algorithm types.EncryptionAlgorithm) int
GetEncryptionBlockSize returns block size
func GetEncryptionIV ¶
func GetEncryptionIV(algorithm types.EncryptionAlgorithm) ([]byte, error)
GetEncryptionIV returns a new IV
func GetIRODSDateTime ¶
GetIRODSDateTime returns time struct from string IRODS time
func GetIRODSDateTimeStringForTicket ¶
GetIRODSDateTimeStringForTicket returns IRODS time string from time struct
func GetIRODSPathDepth ¶
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 ¶
GetIRODSPathDirname returns the dir of the path
func GetIRODSPathFileName ¶
GetIRODSPathFileName returns the filename of the path
func GetIRODSZone ¶
GetIRODSZone returns the zone of the path
func GetNumTasksForParallelTransfer ¶
GetNumTasksForParallelTransfer returns the number transfer tasks to be used
func GetParentIRODSDirs ¶
GetParentDirs returns all parent dirs
func GetPasswordPadded ¶
GetPasswordPadded returns password with padding
func GetRelativeIRODSPath ¶
GetRelativePath returns relative path
func MakeIRODSPath ¶
MakeIRODSPath makes the path from collection and data object
func MakeRandomString ¶
MakeRandomString returns a random string
func ObfuscateNewPassword ¶
ObfuscateNewPassword obfuscates new password for changing
func ReadBytesWithTrackerCallBack ¶
func ReadBytesWithTrackerCallBack(socket net.Conn, buffer []byte, size int, callback common.TrackerCallBack) (int, error)
ReadBytesWithTrackerCallBack reads data from socket in a particular size
func ScrambleV2 ¶
ScrambleV2 scrambles string (ver2)
func SplitIRODSPath ¶
SplitIRODSPath splits the path into dir and file
func WaitTimeout ¶
WaitTimeout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out.
func WriteBytes ¶
WriteBytes writes data to socket
func WriteBytesWithTrackerCallBack ¶
func WriteBytesWithTrackerCallBack(socket net.Conn, buffer []byte, size int, callback common.TrackerCallBack) error
WriteBytesWithTrackerCallBack writes data to socket
Types ¶
This section is empty.