fs

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) (simplecontent.BlobStore, error)

New creates a new filesystem storage backend

Types

type Backend

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

Backend is a filesystem implementation of the simplecontent.BlobStore interface

func (*Backend) Delete

func (b *Backend) Delete(ctx context.Context, objectKey string) error

Delete deletes content from the filesystem

func (*Backend) Download

func (b *Backend) Download(ctx context.Context, objectKey string) (io.ReadCloser, error)

Download downloads content directly from the filesystem

func (*Backend) GetDownloadURL

func (b *Backend) GetDownloadURL(ctx context.Context, objectKey string, downloadFilename string) (string, error)

GetDownloadURL returns a URL for downloading content

func (*Backend) GetObjectMeta

func (b *Backend) GetObjectMeta(ctx context.Context, objectKey string) (*simplecontent.ObjectMeta, error)

GetObjectMeta retrieves metadata for an object in the filesystem

func (*Backend) GetPreviewURL

func (b *Backend) GetPreviewURL(ctx context.Context, objectKey string) (string, error)

GetPreviewURL returns a URL for previewing content

func (*Backend) GetUploadURL

func (b *Backend) GetUploadURL(ctx context.Context, objectKey string) (string, error)

GetUploadURL returns a URL for uploading content

func (*Backend) Upload

func (b *Backend) Upload(ctx context.Context, objectKey string, reader io.Reader) error

Upload uploads content directly to the filesystem

func (*Backend) UploadWithParams

func (b *Backend) UploadWithParams(ctx context.Context, reader io.Reader, params simplecontent.UploadParams) error

UploadWithParams uploads content with additional parameters

type Config

type Config struct {
	BaseDir   string // Base directory for storing files
	URLPrefix string // Optional URL prefix for download/upload URLs
}

Config options for the filesystem backend

Jump to

Keyboard shortcuts

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