appfs

package
v0.0.0-...-4b98c26 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileInfo

func NewFileInfo(name string, size int64, mode os.FileMode) os.FileInfo

NewFileInfo returns an os.FileInfo

Types

type Copier

type Copier interface {
	Start(slug, version, shasum string) (exists bool, err error)
	Copy(stat os.FileInfo, src io.Reader) error
	Abort() error
	Commit() error
}

Copier is an interface defining a common set of functions for the installer to copy the application into an unknown storage.

func NewAferoCopier

func NewAferoCopier(fs afero.Fs) Copier

NewAferoCopier defines a copier using an afero.Fs filesystem to store the application data.

func NewSwiftCopier

func NewSwiftCopier(conn *swift.Connection, appsType consts.AppType) Copier

NewSwiftCopier defines a Copier storing data into a swift container.

type FileServer

type FileServer interface {
	Open(slug, version, shasum, file string) (io.ReadCloser, error)
	FilesList(slug, version, shasum string) ([]string, error)
	ServeFileContent(w http.ResponseWriter, req *http.Request,
		slug, version, shasum, file string) error
}

FileServer interface defines a way to access and serve the application's data files.

func NewAferoFileServer

func NewAferoFileServer(fs afero.Fs, makePath func(slug, version, shasum, file string) string) FileServer

NewAferoFileServer returns a simple wrapper of the afero.Fs interface that provides the apps.FileServer interface.

You can provide a makePath method to define how the file name should be created from the application's slug, version and file name. If not provided, the standard VFS concatenation (starting with vfs.WebappsDirName) is used.

func NewSwiftFileServer

func NewSwiftFileServer(conn *swift.Connection, appsType consts.AppType) FileServer

NewSwiftFileServer returns provides the apps.FileServer implementation using the swift backend as file server.

Jump to

Keyboard shortcuts

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