storage

package
v0.0.0-...-c20e4a3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStorageBackend

type BaseStorageBackend interface {
	// GetFile Get the package from the storage backend
	GetFile(key string) (io.ReadCloser, error)
	// GetMetadata Get the package JSON metadata from the storage backend
	GetMetadata(key string, value interface{}) error
	// WriteFile Write the package to the storage backend
	WriteFile(key string, metadata interface{}, r io.Reader) error
	// CopyFile Copy the package from the storage backend
	CopyFile(fromKey, toKey string) error
	// DeleteFile Delete the package from the storage backend
	DeleteFile(key string) error
}

type FileSystemBackend

type FileSystemBackend struct {
	BaseStorageBackend
	// contains filtered or unexported fields
}

func NewFileSystemBackend

func NewFileSystemBackend(basDir string) *FileSystemBackend

func (*FileSystemBackend) CopyFile

func (s *FileSystemBackend) CopyFile(fromKey, toKey string) error

func (*FileSystemBackend) DeleteFile

func (s *FileSystemBackend) DeleteFile(key string) error

func (*FileSystemBackend) GetFile

func (s *FileSystemBackend) GetFile(key string) (io.ReadCloser, error)

func (*FileSystemBackend) GetMetadata

func (s *FileSystemBackend) GetMetadata(key string, value interface{}) error

func (*FileSystemBackend) WriteFile

func (s *FileSystemBackend) WriteFile(key string, fileMeta interface{}, r io.Reader) error

type InMemoryBackend

type InMemoryBackend struct {
	BaseStorageBackend
	// contains filtered or unexported fields
}

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

func (*InMemoryBackend) CopyFile

func (s *InMemoryBackend) CopyFile(fromKey, toKey string) error

func (*InMemoryBackend) DeleteFile

func (s *InMemoryBackend) DeleteFile(key string) error

func (*InMemoryBackend) GetFile

func (s *InMemoryBackend) GetFile(key string) (io.ReadCloser, error)

func (*InMemoryBackend) GetMetadata

func (s *InMemoryBackend) GetMetadata(key string, value interface{}) error

func (*InMemoryBackend) WriteFile

func (s *InMemoryBackend) WriteFile(key string, fileMeta interface{}, r io.Reader) error

type InMemoryFile

type InMemoryFile struct {
	// contains filtered or unexported fields
}

type S3Backend

type S3Backend struct {
	BaseStorageBackend

	Bucket string
	// contains filtered or unexported fields
}

func NewS3Backend

func NewS3Backend() *S3Backend

func (*S3Backend) CopyFile

func (s *S3Backend) CopyFile(fromKey, toKey string) error

func (*S3Backend) DeleteFile

func (s *S3Backend) DeleteFile(key string) error

func (*S3Backend) GetFile

func (s *S3Backend) GetFile(key string) (io.ReadCloser, error)

func (*S3Backend) GetMetadata

func (s *S3Backend) GetMetadata(key string, value interface{}) error

func (*S3Backend) WriteFile

func (s *S3Backend) WriteFile(key string, fileMeta interface{}, r io.Reader) error

Jump to

Keyboard shortcuts

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