connection

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 22 Imported by: 6

Documentation

Index

Constants

View Source
const (
	TCPBufferSizeDefault int = 4 * 1024 * 1024
)

Variables

View Source
var ErrInvalidUTF8 = xerrors.Errorf("invalid utf-8 character")

ErrInvalidUTF8 is returned if an invalid utf-8 character is found.

Functions

This section is empty.

Types

type CheckErrorResponse added in v0.4.4

type CheckErrorResponse interface {
	Response
	CheckError() error
}

CheckErrorResponse is a Response on which CheckError can be called.

type IRODSConnection

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

IRODSConnection connects to iRODS

func NewIRODSConnection

func NewIRODSConnection(account *types.IRODSAccount, requestTimeout time.Duration, applicationName string) *IRODSConnection

NewIRODSConnection create a IRODSConnection

func NewIRODSConnectionWithMetrics added in v0.9.7

func NewIRODSConnectionWithMetrics(account *types.IRODSAccount, requestTimeout time.Duration, applicationName string, metrics *metrics.IRODSMetrics) *IRODSConnection

NewIRODSConnectionWithMetrics create a IRODSConnection

func (*IRODSConnection) Commit added in v0.4.4

func (conn *IRODSConnection) Commit() error

Commit a transaction. This is useful in combination with the NO_COMMIT_FLAG. Usage is limited to privileged accounts.

func (*IRODSConnection) Connect

func (conn *IRODSConnection) Connect() error

Connect connects to iRODS

func (*IRODSConnection) Disconnect

func (conn *IRODSConnection) Disconnect() error

Disconnect disconnects

func (*IRODSConnection) GetAccount added in v0.6.0

func (conn *IRODSConnection) GetAccount() *types.IRODSAccount

GetAccount returns iRODSAccount

func (*IRODSConnection) GetClientSignature added in v0.10.0

func (conn *IRODSConnection) GetClientSignature() string

GetClientSignature returns client signature to be used in password obfuscation

func (*IRODSConnection) GetCreationTime added in v0.6.0

func (conn *IRODSConnection) GetCreationTime() time.Time

GetCreationTime returns creation time

func (*IRODSConnection) GetLastSuccessfulAccess added in v0.5.6

func (conn *IRODSConnection) GetLastSuccessfulAccess() time.Time

GetLastSuccessfulAccess returns last successful access time

func (*IRODSConnection) GetMetrics added in v0.9.7

func (conn *IRODSConnection) GetMetrics() *metrics.IRODSMetrics

GetMetrics returns metrics

func (*IRODSConnection) GetPAMToken added in v0.14.0

func (conn *IRODSConnection) GetPAMToken() string

GetPAMToken returns server generated token For PAM Auth

func (*IRODSConnection) GetSSLSharedSecret added in v0.14.0

func (conn *IRODSConnection) GetSSLSharedSecret() []byte

GetSSLSharedSecret returns ssl shared secret

func (*IRODSConnection) GetVersion

func (conn *IRODSConnection) GetVersion() *types.IRODSVersion

GetVersion returns iRODS version

func (*IRODSConnection) IsConnected

func (conn *IRODSConnection) IsConnected() bool

IsConnected returns if the connection is live

func (*IRODSConnection) IsSSL added in v0.14.0

func (conn *IRODSConnection) IsSSL() bool

IsSSL returns if the connection is ssl

func (*IRODSConnection) IsTransactionDirty added in v0.12.6

func (conn *IRODSConnection) IsTransactionDirty() bool

IsTransactionDirty returns true if transaction is dirty

func (*IRODSConnection) Lock added in v0.9.6

func (conn *IRODSConnection) Lock()

Lock locks connection

func (*IRODSConnection) PoorMansRollback added in v0.4.4

func (conn *IRODSConnection) PoorMansRollback() error

PoorMansRollback rolls back a transaction as a nonprivileged account, bypassing API limitations. A nonprivileged account cannot have staged operations, so rollback is always a no-op. The usage for this function, is that rolling back the current database transaction still will start a new one, so that future queries will see all changes that where made up to calling this function.

func (*IRODSConnection) PostprocessMessage added in v0.4.4

func (conn *IRODSConnection) PostprocessMessage(msg *message.IRODSMessage) error

PostprocessMessage prepares a message that is received from irods for XML parsing.

func (*IRODSConnection) PostprocessXML added in v0.4.4

func (conn *IRODSConnection) PostprocessXML(in []byte) ([]byte, error)

PostprocessXML translates IRODS XML into valid XML. We fix the invalid encoding of ` as &quot.

func (*IRODSConnection) PreprocessMessage added in v0.4.4

func (conn *IRODSConnection) PreprocessMessage(msg *message.IRODSMessage, forPassword bool) error

PreprocessMessage modifies a request message to use irods dialect for XML.

func (*IRODSConnection) PreprocessXML added in v0.4.4

func (conn *IRODSConnection) PreprocessXML(in []byte) ([]byte, error)

PreprocessXML translates output of xml.Marshal into XML that IRODS understands.

func (*IRODSConnection) PreprocessXMLForPassword added in v0.10.0

func (conn *IRODSConnection) PreprocessXMLForPassword(in []byte) ([]byte, error)

PreprocessXMLForPassword translates output of xml.Marshal into XML that IRODS understands.

func (*IRODSConnection) RawBind added in v0.4.5

func (conn *IRODSConnection) RawBind(socket net.Conn)

RawBind binds an IRODSConnection to a raw net.Conn socket - to be used for e.g. a proxy server setup

func (*IRODSConnection) ReadMessage

func (conn *IRODSConnection) ReadMessage(bsBuffer []byte) (*message.IRODSMessage, error)

ReadMessage reads data from the given socket and returns IRODSMessage if bsBuffer is given, bs data will be written directly to the bsBuffer if not given, a new buffer will be allocated.

func (*IRODSConnection) ReadMessageWithTrackerCallBack added in v0.10.8

func (conn *IRODSConnection) ReadMessageWithTrackerCallBack(bsBuffer []byte, callback common.TrackerCallBack) (*message.IRODSMessage, error)

func (*IRODSConnection) Recv

func (conn *IRODSConnection) Recv(buffer []byte, size int) (int, error)

Recv receives a message

func (*IRODSConnection) RecvToWriter added in v0.11.0

func (conn *IRODSConnection) RecvToWriter(writer io.Writer, size int64) (int64, error)

RecvToWriter receives a message to Writer

func (*IRODSConnection) RecvWithTrackerCallBack added in v0.10.8

func (conn *IRODSConnection) RecvWithTrackerCallBack(buffer []byte, size int, callback common.TrackerCallBack) (int, error)

Recv receives a message

func (*IRODSConnection) Request added in v0.4.4

func (conn *IRODSConnection) Request(request Request, response Response, bsBuffer []byte) error

Request sends a request and expects a response. bsBuffer is optional

func (*IRODSConnection) RequestAndCheck added in v0.4.4

func (conn *IRODSConnection) RequestAndCheck(request Request, response CheckErrorResponse, bsBuffer []byte) error

RequestAndCheck sends a request and expects a CheckErrorResponse, on which the error is already checked.

func (*IRODSConnection) RequestAndCheckForPassword added in v0.10.0

func (conn *IRODSConnection) RequestAndCheckForPassword(request Request, response CheckErrorResponse, bsBuffer []byte) error

RequestAndCheckForPassword sends a request and expects a CheckErrorResponse, on which the error is already checked. Only escape '&'

func (*IRODSConnection) RequestAndCheckWithTrackerCallBack added in v0.10.8

func (conn *IRODSConnection) RequestAndCheckWithTrackerCallBack(request Request, response CheckErrorResponse, bsBuffer []byte, reqCallback common.TrackerCallBack, resCallback common.TrackerCallBack) error

RequestAndCheckWithCallBack sends a request and expects a CheckErrorResponse, on which the error is already checked.

func (*IRODSConnection) RequestAsyncWithTrackerCallBack added in v0.11.4

func (conn *IRODSConnection) RequestAsyncWithTrackerCallBack(rrChan chan RequestResponsePair) chan RequestResponsePair

RequestAsyncWithTrackerCallBack sends multiple requests and expects responses.

func (*IRODSConnection) RequestForPassword added in v0.10.0

func (conn *IRODSConnection) RequestForPassword(request Request, response Response, bsBuffer []byte) error

RequestForPassword sends a request and expects a response. XML escape only for '&' bsBuffer is optional

func (*IRODSConnection) RequestWithTrackerCallBack added in v0.10.8

func (conn *IRODSConnection) RequestWithTrackerCallBack(request Request, response Response, bsBuffer []byte, reqCallback common.TrackerCallBack, resCallback common.TrackerCallBack) error

RequestWithTrackerCallBack sends a request and expects a response. bsBuffer is optional

func (*IRODSConnection) RequestWithoutResponse added in v0.9.0

func (conn *IRODSConnection) RequestWithoutResponse(request Request) error

RequestWithoutResponse sends a request but does not wait for a response.

func (*IRODSConnection) RequestWithoutResponseNoXML added in v0.9.5

func (conn *IRODSConnection) RequestWithoutResponseNoXML(request Request) error

RequestWithoutResponseNoXML sends a request but does not wait for a response.

func (*IRODSConnection) Rollback added in v0.4.4

func (conn *IRODSConnection) Rollback() error

Rollback a transaction. This is useful in combination with the NO_COMMIT_FLAG. It can also be used to clear the current database transaction if there are no staged operations, just to refresh the view on the database for future queries. Usage is limited to privileged accounts.

func (*IRODSConnection) Send

func (conn *IRODSConnection) Send(buffer []byte, size int) error

Send sends data

func (*IRODSConnection) SendFromReader added in v0.11.0

func (conn *IRODSConnection) SendFromReader(src io.Reader, size int64) error

SendFromReader sends data from Reader

func (*IRODSConnection) SendMessage

func (conn *IRODSConnection) SendMessage(msg *message.IRODSMessage) error

SendMessage makes the message into bytes

func (*IRODSConnection) SendMessageWithTrackerCallBack added in v0.10.8

func (conn *IRODSConnection) SendMessageWithTrackerCallBack(msg *message.IRODSMessage, callback common.TrackerCallBack) error

SendMessageWithTrackerCallBack makes the message into bytes

func (*IRODSConnection) SendWithTrackerCallBack added in v0.10.8

func (conn *IRODSConnection) SendWithTrackerCallBack(buffer []byte, size int, callback common.TrackerCallBack) error

SendWithTrackerCallBack sends data

func (*IRODSConnection) SetTCPBufferSize added in v0.11.0

func (conn *IRODSConnection) SetTCPBufferSize(bufferSize int)

SetTCPBufferSize sets TCP Buffer Size

func (*IRODSConnection) SetTransactionDirty added in v0.12.6

func (conn *IRODSConnection) SetTransactionDirty(dirtyTransaction bool)

SetTransactionDirty sets if transaction is dirty

func (*IRODSConnection) SupportParallelUpload added in v0.10.11

func (conn *IRODSConnection) SupportParallelUpload() bool

SupportParallelUpload checks if the server supports parallel upload available from 4.2.9

func (*IRODSConnection) Unlock added in v0.9.6

func (conn *IRODSConnection) Unlock()

Unlock unlocks connection

type IRODSResourceServerConnection added in v0.14.0

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

IRODSResourceServerConnection connects to iRODS resource server

func NewIRODSResourceServerConnection added in v0.14.0

func NewIRODSResourceServerConnection(rootConnection *IRODSConnection, redirectionInfo *types.IRODSRedirectionInfo) *IRODSResourceServerConnection

NewIRODSResourceServerConnection create a IRODSResourceServerConnection

func NewIRODSResourceServerConnectionWithMetrics added in v0.14.0

func NewIRODSResourceServerConnectionWithMetrics(controlConnection *IRODSConnection, redirectionInfo *types.IRODSRedirectionInfo, metrics *metrics.IRODSMetrics) *IRODSResourceServerConnection

NewIRODSResourceServerConnectionWithMetrics create a IRODSResourceServerConnection

func (*IRODSResourceServerConnection) Connect added in v0.14.0

func (conn *IRODSResourceServerConnection) Connect() error

Connect connects to iRODS

func (*IRODSResourceServerConnection) Decrypt added in v0.14.0

func (conn *IRODSResourceServerConnection) Decrypt(iv []byte, source []byte, dest []byte) (int, error)

Decrypt decrypts byte buf

func (*IRODSResourceServerConnection) Disconnect added in v0.14.0

func (conn *IRODSResourceServerConnection) Disconnect() error

Disconnect disconnects

func (*IRODSResourceServerConnection) Encrypt added in v0.14.0

func (conn *IRODSResourceServerConnection) Encrypt(iv []byte, source []byte, dest []byte) (int, error)

Decrypt decrypts byte buf

func (*IRODSResourceServerConnection) GetCreationTime added in v0.14.0

func (conn *IRODSResourceServerConnection) GetCreationTime() time.Time

GetCreationTime returns creation time

func (*IRODSResourceServerConnection) GetLastSuccessfulAccess added in v0.14.0

func (conn *IRODSResourceServerConnection) GetLastSuccessfulAccess() time.Time

GetLastSuccessfulAccess returns last successful access time

func (*IRODSResourceServerConnection) GetMetrics added in v0.14.0

GetMetrics returns metrics

func (*IRODSResourceServerConnection) GetServerInfo added in v0.14.0

GetAccount returns iRODSAccount

func (*IRODSResourceServerConnection) IsConnected added in v0.14.0

func (conn *IRODSResourceServerConnection) IsConnected() bool

IsConnected returns if the connection is live

func (*IRODSResourceServerConnection) Lock added in v0.14.0

func (conn *IRODSResourceServerConnection) Lock()

Lock locks connection

func (*IRODSResourceServerConnection) Recv added in v0.14.0

func (conn *IRODSResourceServerConnection) Recv(buffer []byte, size int) (int, error)

Recv receives a message

func (*IRODSResourceServerConnection) RecvToWriter added in v0.14.0

func (conn *IRODSResourceServerConnection) RecvToWriter(writer io.Writer, size int64) (int64, error)

RecvToWriter receives a message to Writer

func (*IRODSResourceServerConnection) RecvWithTrackerCallBack added in v0.14.0

func (conn *IRODSResourceServerConnection) RecvWithTrackerCallBack(buffer []byte, size int, callback common.TrackerCallBack) (int, error)

RecvWithTrackerCallBack receives a message

func (*IRODSResourceServerConnection) Send added in v0.14.0

func (conn *IRODSResourceServerConnection) Send(buffer []byte, size int) error

Send sends data

func (*IRODSResourceServerConnection) SendFromReader added in v0.14.0

func (conn *IRODSResourceServerConnection) SendFromReader(src io.Reader, size int64) error

SendFromReader sends data from Reader

func (*IRODSResourceServerConnection) SendWithTrackerCallBack added in v0.14.0

func (conn *IRODSResourceServerConnection) SendWithTrackerCallBack(buffer []byte, size int, callback common.TrackerCallBack) error

SendWithTrackerCallBack sends data

func (*IRODSResourceServerConnection) Unlock added in v0.14.0

func (conn *IRODSResourceServerConnection) Unlock()

Unlock unlocks connection

type Request added in v0.4.4

type Request interface {
	GetMessage() (*message.IRODSMessage, error)
}

Request is an interface for calling iRODS RPC.

type RequestResponsePair added in v0.11.4

type RequestResponsePair struct {
	Request          Request
	Response         Response
	BsBuffer         []byte                 // can be null
	RequestCallback  common.TrackerCallBack // can be null
	ResponseCallback common.TrackerCallBack // can be null
	Error            error
}

RequestResponsePair is a structure that wraps Request, Response, and other parameters for making iRODS RPC call.

type Response added in v0.4.4

type Response interface {
	FromMessage(*message.IRODSMessage) error
}

Response is an interface for response of iRODS RPC Call.

Jump to

Keyboard shortcuts

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