helpers

package
v3.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, path string, 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, path string) error

CreateFolder creates a folder in the given path.

func CreateStructure

func CreateStructure(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, root string, f Resource) error

CreateStructure creates the given structure.

func Download

Download downloads the content of a file in one step.

func SameContentWebDAV

func SameContentWebDAV(cl *gowebdav.Client, root string, f Resource) (bool, error)

SameContentWebDAV checks that starting from the root path the webdav client sees the same content defined in the Resource.

func TempDir

func TempDir(name string) (string, error)

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

func TempFile(r io.Reader) (string, error)

TempFile creates a temporary file returning its path. The file is filled with the provider r if not nil.

func TempJSONFile

func TempJSONFile(c any) (string, error)

TempJSONFile creates a temporary file returning its path. The file is filled with the object encoded in json.

func Upload

func Upload(ctx context.Context, fs storage.FS, ref *provider.Reference, content []byte) error

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.

Types

type File

type File struct {
	Content string
}

File implements the Resource interface.

type Folder

type Folder map[string]Resource

Folder implements the Resource interface.

type Resource

type Resource interface {
	// contains filtered or unexported methods
}

Resource represents a general resource (file or folder).

Jump to

Keyboard shortcuts

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