Documentation
¶
Index ¶
- func CreateFile(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ...) error
- func CreateFolder(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ...) error
- func CreateStructure(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ...) error
- func CrossDeviceTempDir(base, pattern string) (string, error)
- func Download(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ...) ([]byte, error)
- func OpenFDsPointingTo(target string) ([]string, error)
- func SameContentWebDAV(cl *gowebdav.Client, root string, f Resource) (bool, error)
- func TempDir(name string) (string, error)
- func TempFile(r io.Reader) (string, error)
- func TempJSONFile(c any) (string, error)
- func Upload(ctx context.Context, fs storage.FS, ref *provider.Reference, content []byte) error
- func UploadGateway(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ...) error
- type File
- type Folder
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
func CreateFile(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref *provider.Reference, content []byte) error
CreateFile creates a file in the given path with an initial content.
func CreateFolder ¶
func CreateFolder(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref *provider.Reference) error
CreateFolder creates a folder in the given path.
func CreateStructure ¶
func CreateStructure(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, root *provider.Reference, f Resource) error
CreateStructure creates the given structure.
func CrossDeviceTempDir ¶ added in v2.52.0
CrossDeviceTempDir creates a temporary directory on a device other than the one base is on. It lets tests trigger the EXDEV rename failures that make file based blobstores fall back to copying instead of moving a file into place.
func Download ¶
func Download(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref *provider.Reference) ([]byte, error)
Download downloads the content of a file in one step.
func OpenFDsPointingTo ¶ added in v2.52.0
OpenFDsPointingTo returns the file descriptors of the current process that refer to the file at target, which is how leaked descriptors are detected. It is only available on Linux, where the open files of a process can be inspected via /proc/self/fd.
func SameContentWebDAV ¶
SameContentWebDAV checks that starting from the root path the webdav client sees the same content defined in the Resource.
func TempDir ¶
TempDir creates a temporary directory in tmp/ and returns its path
Temporary test directories are created in reva/tmp because system /tmp directories are often tmpfs mounts which do not support user extended attributes.
func TempFile ¶
TempFile creates a temporary file returning its path. The file is filled with the provider r if not nil.
func TempJSONFile ¶
TempJSONFile creates a temporary file returning its path. The file is filled with the object encoded in json.
func Upload ¶
Upload can be used to initiate an upload and do the upload to a storage.FS in one step
func UploadGateway ¶
func UploadGateway(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref *provider.Reference, content []byte) error
UploadGateway uploads in one step a the content in a file.