Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileInfo ¶
NewFileInfo returns an os.FileInfo
func S3AppsStorageType ¶
S3AppsStorageType returns the S3 storage type for an application.
Types ¶
type Copier ¶
type Copier interface {
Exist(slug, version, shasum string) (exists bool, err error)
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 ¶
NewAferoCopier defines a copier using an afero.Fs filesystem to store the application data.
func NewS3Copier ¶
NewS3Copier creates a Copier that stores app files in S3.
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
ServeCodeTarball(w http.ResponseWriter, req *http.Request,
slug, version, shasum 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 NewS3FileServer ¶
func NewS3FileServer(client *minio.Client, bucket, prefix string) FileServer
NewS3FileServer creates a FileServer that serves app files from S3.
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.