client

package
v0.12.10 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: BSD-3-Clause Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRoutingKey added in v0.12.9

func MakeRoutingKey(account *irodsclient_types.IRODSAccount) string

MakeRoutingKey derives the routing key of an iRODS account. It names the user, not the session: every session of the user - whatever ticket or default resource it logs in with - gets the same key, so that a reverse proxy hashing on it sends them all to the one server holding the user's staged writes and file locks. Ticket logins are the exception, keyed by their ticket as well, so that anonymous ticket users do not all land on a single server. The key is a hash so that proxy logs do not show user names.

Types

type MetadataCache added in v0.5.9

type MetadataCache struct {
	// contains filtered or unexported fields
}

MetadataCache manages filesystem metadata caches

func NewMetadataCache added in v0.5.9

func NewMetadataCache(cacheTimeout time.Duration, cleanup time.Duration) *MetadataCache

NewMetadataCache creates a new MetadataCache

func (*MetadataCache) AddDirCache added in v0.5.9

func (cache *MetadataCache) AddDirCache(path string, entries []string)

AddDirCache adds a dir cache

func (*MetadataCache) AddEntryCache added in v0.5.9

func (cache *MetadataCache) AddEntryCache(entry *irodsclient_fs.Entry)

AddEntryCache adds an entry cache

func (*MetadataCache) ClearDirCache added in v0.5.9

func (cache *MetadataCache) ClearDirCache()

ClearDirCache clears all dir caches

func (*MetadataCache) ClearEntryCache added in v0.5.9

func (cache *MetadataCache) ClearEntryCache()

ClearEntryCache clears all entry caches

func (*MetadataCache) GetDirCache added in v0.5.9

func (cache *MetadataCache) GetDirCache(path string) []string

GetDirCache retrives a dir cache

func (*MetadataCache) GetEntryCache added in v0.5.9

func (cache *MetadataCache) GetEntryCache(path string) *irodsclient_fs.Entry

GetEntryCache retrieves an entry cache

func (*MetadataCache) RemoveDirCache added in v0.5.9

func (cache *MetadataCache) RemoveDirCache(path string)

RemoveDirCache removes a dir cache

func (*MetadataCache) RemoveEntryCache added in v0.5.9

func (cache *MetadataCache) RemoveEntryCache(path string)

RemoveEntryCache removes an entry cache

type PoolServiceClient

type PoolServiceClient struct {
	// contains filtered or unexported fields
}

PoolServiceClient is a client of pool service

func NewPoolServiceClient

func NewPoolServiceClient(address string, operationTimeout time.Duration, autoReconnect bool, clientID string, account *irodsclient_types.IRODSAccount, applicationName string, description string, logger *log.Entry) *PoolServiceClient

NewPoolServiceClient creates a client of the pool service for one iRODS account. A client holds exactly one session: Connect logs in with the account, and Release logs out.

clientID names this client to the server for as long as it lives, across reconnects, and scopes the file lock owners it reports. Callers that have an id of their own - a mount instance id, say - should pass it so that one id identifies them in their own logs and in the server's. An empty id gets a generated one.

The routing key sent with every call is derived from the account, so that a reverse proxy can route all clients of the same user to the same server.

func (*PoolServiceClient) Connect

Connect connects to pool service, logs in with the client's account, and returns the session. Calling it on a client that is already connected returns the session it already has.

func (*PoolServiceClient) GetID added in v0.12.4

func (client *PoolServiceClient) GetID() string

GetID returns the id this client is known by, in its own logs and in the server's

func (*PoolServiceClient) GetRoutingKey added in v0.12.9

func (client *PoolServiceClient) GetRoutingKey() string

GetRoutingKey returns the routing key this client sends with every call

func (*PoolServiceClient) GetSession added in v0.12.9

GetSession returns the session of the client, nil if not connected

func (*PoolServiceClient) Release added in v0.12.9

func (client *PoolServiceClient) Release() error

Release releases all resources of the client: it disconnects the client if it is still connected, and drops the local metadata cache

type PoolServiceFileHandle

type PoolServiceFileHandle struct {
	// contains filtered or unexported fields
}

PoolServiceFileHandle implements IRODSFSFileHandle

func (*PoolServiceFileHandle) Close added in v0.5.0

func (handle *PoolServiceFileHandle) Close() error

func (*PoolServiceFileHandle) Flush added in v0.5.0

func (handle *PoolServiceFileHandle) Flush() error

Flush flushes iRODS data object handle

func (*PoolServiceFileHandle) GetAvailable added in v0.5.4

func (handle *PoolServiceFileHandle) GetAvailable(offset int64) int64

func (*PoolServiceFileHandle) GetEntry added in v0.3.5

func (handle *PoolServiceFileHandle) GetEntry() *irodsclient_fs.Entry

func (*PoolServiceFileHandle) GetID added in v0.5.0

func (handle *PoolServiceFileHandle) GetID() string

func (*PoolServiceFileHandle) GetOpenMode added in v0.3.5

func (*PoolServiceFileHandle) Getlk added in v0.12.4

Getlk returns a lock that conflicts with the given lock, or nil if the lock can be acquired

func (*PoolServiceFileHandle) IsReadMode

func (handle *PoolServiceFileHandle) IsReadMode() bool

func (*PoolServiceFileHandle) IsWriteMode

func (handle *PoolServiceFileHandle) IsWriteMode() bool

func (*PoolServiceFileHandle) ReadAt added in v0.5.0

func (handle *PoolServiceFileHandle) ReadAt(buffer []byte, offset int64) (int, error)

ReadAt reads iRODS data object

func (*PoolServiceFileHandle) Setlk added in v0.12.4

Setlk acquires or releases a lock without waiting. It returns an error wrapping irods.ErrFileLockConflict if the lock is held by another owner.

func (*PoolServiceFileHandle) Setlkw added in v0.12.4

Setlkw acquires a lock, waiting until it becomes available or the context is canceled. The wait happens on the server, so the call carries the caller's context rather than the client operation timeout: canceling it cancels the gRPC call, which ends the wait on the server too.

func (*PoolServiceFileHandle) Truncate added in v0.5.0

func (handle *PoolServiceFileHandle) Truncate(size int64) error

Truncate truncates iRODS data object

func (*PoolServiceFileHandle) WriteAt added in v0.5.0

func (handle *PoolServiceFileHandle) WriteAt(data []byte, offset int64) (int, error)

WriteAt writes iRODS data object

type PoolServiceSession

type PoolServiceSession struct {
	// contains filtered or unexported fields
}

func (*PoolServiceSession) CacheFile added in v0.12.0

func (session *PoolServiceSession) CacheFile(irodsPath string, transferCallback irodsclient_common.TransferTrackerCallback) error

CacheFile requests the pool server to cache file content (synchronous)

func (*PoolServiceSession) CacheFileAsync added in v0.12.0

func (session *PoolServiceSession) CacheFileAsync(irodsPath string)

CacheFileAsync requests the pool server to cache file content in background. The server returns immediately and caches asynchronously. Session release on the server waits for the caching to complete.

func (*PoolServiceSession) CreateFile added in v0.5.0

func (session *PoolServiceSession) CreateFile(path string, mode string) (irodsfs_common_irods.IRODSFSFileHandle, error)

CreateFile creates a new iRODS data object

func (*PoolServiceSession) CreateFileBulk added in v0.12.0

func (session *PoolServiceSession) CreateFileBulk(path string, mode string) (irodsfs_common_irods.IRODSFSFileHandle, error)

CreateFileBulk creates an iRODS data object for bulk upload (file is synced and deleted after close)

func (*PoolServiceSession) DownloadFile added in v0.12.0

func (session *PoolServiceSession) DownloadFile(irodsPath string, localPath string, transferCallback irodsclient_common.TransferTrackerCallback) error

DownloadFile downloads iRODS file to local path using ReadStream

func (*PoolServiceSession) DownloadFileParallel added in v0.12.0

func (session *PoolServiceSession) DownloadFileParallel(irodsPath string, localPath string, taskNum int, transferCallback irodsclient_common.TransferTrackerCallback) error

DownloadFileParallel downloads iRODS file to local path (uses single stream)

func (*PoolServiceSession) DownloadFileParallelWithCallback added in v0.12.0

func (session *PoolServiceSession) DownloadFileParallelWithCallback(irodsPath string, blockSize int, numBlocks int, blockReadyCallback irodsclient_common.DataObjectBlockCallback, taskNum int, transferCallback irodsclient_common.TransferTrackerCallback) error

DownloadFileParallelWithCallback downloads iRODS file with callback using parallel reading on the server

func (*PoolServiceSession) DownloadFileWithCallback added in v0.12.0

func (session *PoolServiceSession) DownloadFileWithCallback(irodsPath string, blockSize int, numBlocks int, blockReadyCallback irodsclient_common.DataObjectBlockCallback, transferCallback irodsclient_common.TransferTrackerCallback) error

DownloadFileWithCallback downloads iRODS file and calls blockReadyCallback for each block

func (*PoolServiceSession) ExistsDir added in v0.5.0

func (session *PoolServiceSession) ExistsDir(path string) bool

ExistsDir checks existence of Dir

func (*PoolServiceSession) ExistsFile added in v0.5.0

func (session *PoolServiceSession) ExistsFile(path string) bool

ExistsFile checks existence of File

func (*PoolServiceSession) GetAccount added in v0.5.0

func (session *PoolServiceSession) GetAccount() *irodsclient_types.IRODSAccount

func (*PoolServiceSession) GetApplicationName added in v0.5.0

func (session *PoolServiceSession) GetApplicationName() string

func (*PoolServiceSession) GetMetrics added in v0.5.13

func (session *PoolServiceSession) GetMetrics() *irodsclient_metrics.IRODSMetrics

func (*PoolServiceSession) GetOpenConnections added in v0.12.0

func (session *PoolServiceSession) GetOpenConnections() int

func (*PoolServiceSession) InvalidateAllCache added in v0.12.0

func (session *PoolServiceSession) InvalidateAllCache()

InvalidateAllCache removes all caches

func (*PoolServiceSession) InvalidateCacheForCreateFile added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForCreateFile(path string)

InvalidateCacheForCreateFile removes caches for file

func (*PoolServiceSession) InvalidateCacheForMakeDir added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForMakeDir(path string)

InvalidateCacheForMakeDir removes caches for dir

func (*PoolServiceSession) InvalidateCacheForRemoveDir added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForRemoveDir(path string, recurse bool)

InvalidateCacheForRemoveDir removes caches for dir

func (*PoolServiceSession) InvalidateCacheForRemoveFile added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForRemoveFile(path string)

InvalidateCacheForRemoveFile removes caches for file

func (*PoolServiceSession) InvalidateCacheForRenameDir added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForRenameDir(srcPath string, destPath string)

InvalidateCacheForRenameDir removes caches for dir

func (*PoolServiceSession) InvalidateCacheForRenameFile added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForRenameFile(srcPath string, destPath string)

InvalidateCacheForRenameFile removes caches for file

func (*PoolServiceSession) InvalidateCacheForUpdateFile added in v0.6.12

func (session *PoolServiceSession) InvalidateCacheForUpdateFile(path string)

InvalidateCacheForUpdateFile removes caches for file

func (*PoolServiceSession) List added in v0.5.0

func (session *PoolServiceSession) List(path string) ([]*irodsclient_fs.Entry, error)

List lists iRODS collection entries

func (*PoolServiceSession) MakeDir added in v0.5.0

func (session *PoolServiceSession) MakeDir(path string, recurse bool) error

MakeDir creates a new iRODS collection

func (*PoolServiceSession) OpenFile added in v0.5.0

OpenFile opens iRODS data object

func (*PoolServiceSession) OpenFileBulk added in v0.12.0

func (session *PoolServiceSession) OpenFileBulk(path string, mode string) (irodsfs_common_irods.IRODSFSFileHandle, error)

OpenFileBulk opens an iRODS data object for bulk upload (file is synced and deleted after close)

func (*PoolServiceSession) Release added in v0.5.0

func (session *PoolServiceSession) Release() error

Release releases all resources of the client the session belongs to

func (*PoolServiceSession) RemoveDir added in v0.5.0

func (session *PoolServiceSession) RemoveDir(path string, recurse bool, force bool) error

RemoveDir removes iRODS collection

func (*PoolServiceSession) RemoveFile added in v0.5.0

func (session *PoolServiceSession) RemoveFile(path string, force bool) error

RemoveFile removes iRODS data object

func (*PoolServiceSession) RenameDirToDir added in v0.5.0

func (session *PoolServiceSession) RenameDirToDir(srcPath string, destPath string) error

RenameDirToDir renames iRODS collection

func (*PoolServiceSession) RenameFileToFile added in v0.5.0

func (session *PoolServiceSession) RenameFileToFile(srcPath string, destPath string) error

RenameFileToFile renames iRODS data object

func (*PoolServiceSession) Stat added in v0.5.0

func (session *PoolServiceSession) Stat(path string) (*irodsclient_fs.Entry, error)

Stat stats iRODS entry

func (*PoolServiceSession) Sync added in v0.12.0

func (session *PoolServiceSession) Sync() error

Sync synchronizes data

func (*PoolServiceSession) TruncateFile added in v0.5.0

func (session *PoolServiceSession) TruncateFile(path string, size int64) error

TruncateFile truncates iRODS data object

func (*PoolServiceSession) UploadFile added in v0.12.0

func (session *PoolServiceSession) UploadFile(localPath string, irodsPath string, transferCallback irodsclient_common.TransferTrackerCallback) error

UploadFile uploads local file to iRODS path using WriteStream

func (*PoolServiceSession) UploadFileParallel added in v0.12.0

func (session *PoolServiceSession) UploadFileParallel(localPath string, irodsPath string, taskNum int, transferCallback irodsclient_common.TransferTrackerCallback) error

UploadFileParallel uploads local file to iRODS path (uses single stream)

Jump to

Keyboard shortcuts

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