objstore

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package objstore provides ObjectStore implementations. The local-filesystem backend (FS) is the v1 default; an S3-compatible backend can be added behind the same teled.ObjectStore interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

FS is a local-filesystem ObjectStore. Objects are stored under a base directory, sharded by the first bytes of the key to avoid huge directories.

func NewFS

func NewFS(base string) (*FS, error)

NewFS creates an FS rooted at base, creating the directory if needed.

func (*FS) Delete

func (s *FS) Delete(_ context.Context, key string) error

Delete implements teled.ObjectStore. A missing object is not an error.

func (*FS) Get

func (s *FS) Get(_ context.Context, key string) (io.ReadCloser, error)

Get implements teled.ObjectStore.

func (*FS) GetRange

func (s *FS) GetRange(_ context.Context, key string, offset, length int64) (io.ReadCloser, error)

GetRange implements teled.ObjectStore, returning length bytes from offset.

func (*FS) Put

func (s *FS) Put(_ context.Context, key string, r io.Reader, _ int64, _ teled.PutOptions) error

Put implements teled.ObjectStore. It writes atomically via a temp file.

func (*FS) Stat

func (s *FS) Stat(_ context.Context, key string) (teled.ObjectInfo, error)

Stat implements teled.ObjectStore.

Jump to

Keyboard shortcuts

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