file

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package file implements a file-backed object store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileStore

func NewFileStore(dir string) (store.ObjectStore, error)

NewFileStore creates an object store backed by a directory

func NewTempFileStore

func NewTempFileStore() (store.ObjectStore, error)

NewTempFileStore creates a file object store using a temporary file

Types

type Store

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

Store a ObjectStore backed by a file system

func (*Store) Download

func (f *Store) Download(_ context.Context, object store.Object) (io.ReadCloser, error)

Download returns the content of the object given its url

func (*Store) Get

func (f *Store) Get(_ context.Context, id string) (store.Object, error)

Get retrieves an objects if exists in the object store or an error otherwise

func (*Store) Put

func (f *Store) Put(_ context.Context, id string, content io.Reader) (store.Object, error)

Put stores the object and returns the metadata Fails if the object already exists

Jump to

Keyboard shortcuts

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