objstore

package
v0.0.0-...-7687a33 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAny

func FromAny(file *multipart.FileHeader, url string) (io.ReadCloser, error)

func FromMultipartFile

func FromMultipartFile(file *multipart.FileHeader) (io.ReadCloser, error)

func FromURL

func FromURL(fileURL string) (io.ReadCloser, error)

func Healthcheck

func Healthcheck(s Store) func(ctx context.Context) error

Types

type Store

type Store interface {
	// Original returns URL to the original file
	Original(id uint64, ext string) string

	// Preview returns URL to the preview (of the original) file
	Preview(id uint64, ext string) string

	// Save stores the file
	Save(filename string, f io.Reader) error

	// Remove deletes the file
	Remove(filename string) error

	// Open returns file handle
	Open(filename string) (io.ReadSeekCloser, error)

	// Healthcheck checks health status of the store
	Healthcheck(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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