file

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(model FileModel)

Init sets the package-level FileModel used by @call Func wrappers.

Types

type DeleteRequest

type DeleteRequest struct {
	Key string
}

type DeleteResponse

type DeleteResponse struct{}

func Delete

func Delete(req DeleteRequest) (DeleteResponse, error)

type DownloadRequest

type DownloadRequest struct {
	Key string
}

type DownloadResponse

type DownloadResponse struct {
	Body string
}

func Download

func Download(req DownloadRequest) (DownloadResponse, error)

type FileModel

type FileModel interface {
	Upload(ctx context.Context, key string, body io.Reader) error
	Download(ctx context.Context, key string) (io.ReadCloser, error)
	Delete(ctx context.Context, key string) error
}

FileModel provides file/object storage operations.

func NewLocalFile

func NewLocalFile(root string) FileModel

NewLocalFile creates a FileModel backed by the local filesystem.

func NewS3File

func NewS3File(client *s3.Client, bucket string) FileModel

NewS3File creates a FileModel backed by AWS S3.

type UploadRequest

type UploadRequest struct {
	Key  string
	Body string
}

type UploadResponse

type UploadResponse struct {
	Key string
}

func Upload

func Upload(req UploadRequest) (UploadResponse, error)

Jump to

Keyboard shortcuts

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