storage

package
v0.0.0-...-50debf6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystemProvider

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

func (FileSystemProvider) AddFile

func (f FileSystemProvider) AddFile(ctx context.Context, fileName string, stream io.Reader) error

func (FileSystemProvider) DeleteFile

func (f FileSystemProvider) DeleteFile(ctx context.Context, filename string) error

func (FileSystemProvider) GetFile

func (f FileSystemProvider) GetFile(ctx context.Context, filename string) (*os.File, error)

type Provider

type Provider interface {
	AddFile(ctx context.Context, filename string, stream io.Reader) error
	GetFile(ctx context.Context, filename string) (*os.File, error)
	DeleteFile(ctx context.Context, filename string) error
}

func NewFilesystemProvider

func NewFilesystemProvider(dest string) Provider

func NewS3Provider

func NewS3Provider(cfg *S3Config) Provider

type S3Config

type S3Config struct {
	BucketName string
	AccessKey  string
	SecretKey  string
	Endpoint   string
	Region     string
	Ssl        bool
}

type S3Provider

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

func (S3Provider) AddFile

func (p S3Provider) AddFile(ctx context.Context, fileName string, stream io.Reader) error

func (S3Provider) DeleteFile

func (p S3Provider) DeleteFile(ctx context.Context, filename string) error

func (S3Provider) GetFile

func (p S3Provider) GetFile(ctx context.Context, filename string) (*os.File, error)

Jump to

Keyboard shortcuts

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