Skip to content

Commit

Permalink
upgrade go-irodsclient
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Aug 30, 2024
1 parent 42b6130 commit 7b3320d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion commons/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "time"
const (
clientProgramName string = "gocommands"
connectionTimeout time.Duration = 10 * time.Minute
filesystemTimeout time.Duration = 10 * time.Minute
TransferThreadNumDefault int = 5
UploadThreadNumMax int = 20
TcpBufferSizeDefault int = 4 * 1024 * 1024
Expand Down
22 changes: 5 additions & 17 deletions commons/irods_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (

// GetIRODSFSClient returns a file system client
func GetIRODSFSClient(account *irodsclient_types.IRODSAccount) (*irodsclient_fs.FileSystem, error) {
fsConfig := irodsclient_fs.NewFileSystemConfig(clientProgramName, irodsclient_fs.FileSystemConnectionErrorTimeoutDefault, irodsclient_fs.FileSystemConnectionInitNumberDefault, irodsclient_fs.FileSystemConnectionLifespanDefault,
filesystemTimeout, filesystemTimeout, irodsclient_fs.FileSystemConnectionMaxDefault, TcpBufferSizeDefault,
irodsclient_fs.FileSystemTimeoutDefault, irodsclient_fs.FileSystemTimeoutDefault, []irodsclient_fs.MetadataCacheTimeoutSetting{}, true, true)
fsConfig := irodsclient_fs.NewFileSystemConfig(clientProgramName)
fsConfig.TCPBufferSize = TcpBufferSizeDefault

return irodsclient_fs.NewFileSystem(account, fsConfig)
}
Expand All @@ -26,9 +25,9 @@ func GetIRODSFSClientAdvanced(account *irodsclient_types.IRODSAccount, maxConnec
tcpBufferSize = TcpBufferSizeDefault
}

fsConfig := irodsclient_fs.NewFileSystemConfig(clientProgramName, irodsclient_fs.FileSystemConnectionErrorTimeoutDefault, irodsclient_fs.FileSystemConnectionInitNumberDefault, irodsclient_fs.FileSystemConnectionLifespanDefault,
filesystemTimeout, filesystemTimeout, maxConnection, tcpBufferSize,
irodsclient_fs.FileSystemTimeoutDefault, irodsclient_fs.FileSystemTimeoutDefault, []irodsclient_fs.MetadataCacheTimeoutSetting{}, true, true)
fsConfig := irodsclient_fs.NewFileSystemConfig(clientProgramName)
fsConfig.ConnectionMax = maxConnection
fsConfig.TCPBufferSize = tcpBufferSize

return irodsclient_fs.NewFileSystem(account, fsConfig)
}
Expand All @@ -43,14 +42,3 @@ func GetIRODSConnection(account *irodsclient_types.IRODSAccount) (*irodsclient_c

return conn, nil
}

// TestConnect just test connection creation
func TestConnect(account *irodsclient_types.IRODSAccount) error {
conn, err := GetIRODSConnection(account)
if err != nil {
return nil
}

defer conn.Disconnect()
return nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/creativeprojects/go-selfupdate v1.0.1
github.com/cyverse/go-irodsclient v0.14.16-0.20240827195018-78c6ec27b7e4
github.com/cyverse/go-irodsclient v0.14.16-0.20240829234908-af2ac5ef0119
github.com/dustin/go-humanize v1.0.1
github.com/gliderlabs/ssh v0.3.5
github.com/jedib0t/go-pretty/v6 v6.3.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creativeprojects/go-selfupdate v1.0.1 h1:5Un4MTv4puCR5GBgkDLC14J72fljGuMC60E63cFGq1o=
github.com/creativeprojects/go-selfupdate v1.0.1/go.mod h1:nm7AWUJfrfYt/SB97NAcMhR0KEpPqlrVHXkWFti+ezw=
github.com/cyverse/go-irodsclient v0.14.16-0.20240827195018-78c6ec27b7e4 h1:swtNISQo69vhNZp/GhvPhFMR8IccFGaW1+8ja3cimy8=
github.com/cyverse/go-irodsclient v0.14.16-0.20240827195018-78c6ec27b7e4/go.mod h1:eBXha3cwfrM0p1ijYVqsrLJQHpRwTfpA4c5dKCQsQFc=
github.com/cyverse/go-irodsclient v0.14.16-0.20240829234908-af2ac5ef0119 h1:TXAE/H5Yd2hEj6uvHKiL04noNWbN0xki540Zv7J9qkU=
github.com/cyverse/go-irodsclient v0.14.16-0.20240829234908-af2ac5ef0119/go.mod h1:eBXha3cwfrM0p1ijYVqsrLJQHpRwTfpA4c5dKCQsQFc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down

0 comments on commit 7b3320d

Please sign in to comment.