objstore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 12 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, providers obs.Providers) (*FS, error)

NewFS creates an FS rooted at base, creating the directory if needed. providers supplies the OpenTelemetry tracer and meter for this layer.

func (*FS) Delete

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

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

func (*FS) Get

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

Get implements teled.ObjectStore.

func (*FS) GetRange

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

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

func (*FS) Put

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

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

func (*FS) Stat

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

Stat implements teled.ObjectStore.

Jump to

Keyboard shortcuts

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