filesystem

package
v0.0.0-...-ad95247 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	StorageKey string
	Path       string
}

func (Local) Key

func (l Local) Key() string

func (Local) OpenRead

func (l Local) OpenRead(_ context.Context, path string) (io.ReadCloser, error)

func (Local) Remove

func (l Local) Remove(_ context.Context, path string) error

func (Local) WriteFile

func (l Local) WriteFile(_ context.Context, cmd ports.WriteFileCommand) (err error)

type S3

type S3 struct {
	StorageKey string
	BucketName string
	Client     S3ObjectClient
}

func (S3) Key

func (s S3) Key() string

func (S3) OpenRead

func (s S3) OpenRead(ctx context.Context, path string) (io.ReadCloser, error)

func (S3) Remove

func (s S3) Remove(ctx context.Context, path string) error

func (S3) WriteFile

func (s S3) WriteFile(ctx context.Context, cmd ports.WriteFileCommand) error

type S3ObjectClient

type S3ObjectClient interface {
	PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (info minio.UploadInfo, err error)
	GetObject(ctx context.Context, bucketName, objectName string, opts minio.GetObjectOptions) (*minio.Object, error)
	RemoveObject(ctx context.Context, bucketName, objectName string, opts minio.RemoveObjectOptions) error
}

type SFTP

type SFTP struct {
	StorageKey string
	Client     SFTPClient
}

func (SFTP) Close

func (s SFTP) Close() error

func (SFTP) Key

func (s SFTP) Key() string

func (SFTP) OpenRead

func (s SFTP) OpenRead(_ context.Context, path string) (io.ReadCloser, error)

func (SFTP) Remove

func (s SFTP) Remove(_ context.Context, path string) error

func (SFTP) WriteFile

func (s SFTP) WriteFile(_ context.Context, cmd ports.WriteFileCommand) error

type SFTPClient

type SFTPClient interface {
	io.Closer
	Create(path string) (*sftp.File, error)
	Open(path string) (*sftp.File, error)
	MkdirAll(path string) error
	Remove(path string) error
}

Jump to

Keyboard shortcuts

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