fileuploader

package
v1.10.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiFileWriter

type MultiFileWriter interface {
	// Write writes the given data to the file at the given path.
	Write(path string, data []byte) (int, error)
	// Close closes all open files.
	Close() error

	// Count returns the number of open files.
	Count() int
}

MultiFileWriter can write to multiple paths at the same time.

func NewGzMultiFileWriter

func NewGzMultiFileWriter() MultiFileWriter

NewGzMultiFileWriter creates a new MultiFileWriter that writes to multiple gz-compressed files.

type Provider

type Provider interface {
	// Gets a file manager for the given workspace.
	GetFileManager(workspaceID string) (filemanager.FileManager, error)
	// Gets the storage preferences for the given workspace.
	GetStoragePreferences(workspaceID string) (backendconfig.StoragePreferences, error)
}

Provider is an interface that provides file managers and storage preferences for a given workspace.

func NewDefaultProvider

func NewDefaultProvider() Provider

NewDefaultProvider creates a new provider that operates against the default storage settings populated from the env. Useful for tests that populate settings from env.

func NewProvider

func NewProvider(ctx context.Context, config backendconfig.BackendConfig) Provider

NewProvider creates a new provider that updates its storage settings while backend configuration gets updated.

func NewStaticProvider

func NewStaticProvider(storageSettings map[string]StorageSettings) Provider

NewStaticProvider creates a new provider that operates against a predefined storage settings. Useful for tests.

type StorageSettings

type StorageSettings struct {
	Bucket      backendconfig.StorageBucket
	Preferences backendconfig.StoragePreferences
}

Jump to

Keyboard shortcuts

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