Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
NewAferoCopier defines a copier using an afero.Fs filesystem to store the application data.
func NewSwiftCopier ¶
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.