Documentation
¶
Overview ¶
Package storage provides local file storage for sandbox execution outputs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Key string `json:"key"`
Size int64 `json:"size"`
LastModified string `json:"last_modified,omitempty"`
URL string `json:"url,omitempty"`
}
File represents a stored file's metadata.
type Service ¶
type Service interface {
// Upload stores a file scoped to an execution and returns its relative key and public URL.
Upload(executionID, name string, body io.Reader) (relativeKey, url string, err error)
// List returns files scoped to an execution, optionally filtered by prefix.
List(executionID, prefix string) ([]File, error)
// GetURL returns the public URL for a file scoped to an execution.
GetURL(executionID, key string) string
// ServeFile serves a stored file over HTTP.
ServeFile(w http.ResponseWriter, r *http.Request, filePath string)
}
Service provides file storage backed by an afero filesystem.
Click to show internal directories.
Click to hide internal directories.