Documentation ¶
Index ¶
- Constants
- func CheckRPCInvocation(operation string, res rpcStatusGetter, callErr error) error
- func CheckRPCStatus(operation string, res rpcStatusGetter) error
- type HTTPRequest
- type TUSClient
- type WebDAVClient
- func NewWebDAVClient(endpoint string, userName string, password string) (*WebDAVClient, error)
- func NewWebDAVClientWithAccessToken(endpoint string, accessToken string) (*WebDAVClient, error)
- func NewWebDAVClientWithOpaque(endpoint string, opaque *types.Opaque) (*WebDAVClient, map[string]string, error)
Constants ¶
const ( // AccessTokenIndex specifies the index of the Reva access token in a context. AccessTokenIndex ctxKey = iota // AccessTokenName specifies the name of the Reva access token used during requests. AccessTokenName = ctxpkg.TokenHeader // TransportTokenName specifies the name of the Reva transport token used during data transfers. TransportTokenName = datagateway.TokenTransportHeader )
const ( // WebDAVTokenName is the header name of the WebDAV token. WebDAVTokenName = "webdav-token" // WebDAVPathName is the header name of the WebDAV file path. WebDAVPathName = "webdav-file-path" )
Variables ¶
This section is empty.
Functions ¶
func CheckRPCInvocation ¶
CheckRPCInvocation checks if an RPC invocation has succeeded. For this, the error from the original call is first checked; after that, the actual RPC response status is checked.
func CheckRPCStatus ¶
CheckRPCStatus checks the returned status of an RPC call.
Types ¶
type HTTPRequest ¶
type HTTPRequest struct {
// contains filtered or unexported fields
}
HTTPRequest performs Reva-specific requests through an HTTP endpoint.
func NewHTTPRequest ¶
func NewHTTPRequest(ctx context.Context, endpoint string, method string, accessToken string, transportToken string, data io.Reader) (*HTTPRequest, error)
NewHTTPRequest creates a new HTTP request.
func (*HTTPRequest) AddParameters ¶
func (request *HTTPRequest) AddParameters(params map[string]string)
AddParameters adds the specified parameters to the request. The parameters are passed in the query URL.
type TUSClient ¶
type TUSClient struct {
// contains filtered or unexported fields
}
TUSClient is a simple client wrapper for uploading files via TUS.
func NewTUSClient ¶
NewTUSClient creates a new TUS client.
func (*TUSClient) Write ¶
func (client *TUSClient) Write(data io.Reader, target string, fileInfo os.FileInfo, checksumType string, checksum string) error
Write writes the provided data to the endpoint. The target is used as the filename on the remote site. The file information and checksum are used to create a fingerprint.
type WebDAVClient ¶
type WebDAVClient struct {
// contains filtered or unexported fields
}
WebDAVClient is a simple client wrapper for down- and uploading files via WebDAV.
func NewWebDAVClient ¶
func NewWebDAVClient(endpoint string, userName string, password string) (*WebDAVClient, error)
NewWebDAVClient creates a new WebDAV client with user credentials.
func NewWebDAVClientWithAccessToken ¶
func NewWebDAVClientWithAccessToken(endpoint string, accessToken string) (*WebDAVClient, error)
NewWebDAVClientWithAccessToken creates a new WebDAV client using an access token.
func NewWebDAVClientWithOpaque ¶
func NewWebDAVClientWithOpaque(endpoint string, opaque *types.Opaque) (*WebDAVClient, map[string]string, error)
NewWebDAVClientWithOpaque creates a new WebDAV client using the information stored in the opaque.
func (*WebDAVClient) Read ¶
func (webdav *WebDAVClient) Read(file string) ([]byte, error)
Read reads all data of the specified remote file.
func (*WebDAVClient) Remove ¶
func (webdav *WebDAVClient) Remove(path string) error
Remove deletes the entire file/path.