Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoPublicUrl = errors.New("No public URL available for this file")
View Source
var ErrNotAFilesystem = errors.New("This items in this blob store can't be accessed as local files")
Functions ¶
Types ¶
type File ¶
type File struct { Reader io.ReadCloser ModifiedAt time.Time Size int64 }
File is an element in blob storage.
type Storage ¶
type Storage interface { // When finished, you must close the WriteCloser WriteFile(name string) (io.WriteCloser, error) // When finished, you must close File.Reader ReadFile(name string) (*File, error) DeleteFile(name string) error // Return a URL to the given file. If that is not possible, return ErrNoPublicUrl. URL(name string) (string, error) // If this is a local filesystem, then return the local path to the file. Filename(name string) (string, error) }
Storage is an abstraction of a blob store (eg S3), or a filesystem
type StorageFS ¶
type StorageFS struct { Root string // contains filtered or unexported fields }
StorageFS is a filesystem-based blob store
func (*StorageFS) DeleteFile ¶
type StorageGCS ¶
type StorageGCS struct {
// contains filtered or unexported fields
}
StorageGCS is a Google Cloud Storage-based blob store
func NewStorageGCS ¶
func (*StorageGCS) DeleteFile ¶
func (s *StorageGCS) DeleteFile(name string) error
func (*StorageGCS) WriteFile ¶
func (s *StorageGCS) WriteFile(name string) (io.WriteCloser, error)
Click to show internal directories.
Click to hide internal directories.