layout

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package layout provides a generic interface for storage layouts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShardedStorage

type ShardedStorage interface {
	// Write saves the data for a given ID.
	// It handles the creation of subdirectories and writing the file.
	Write(id string, data []byte) error

	// Read retrieves the data for a given ID.
	Read(id string) ([]byte, error)

	// Exists checks if data exists for a given ID.
	Exists(id string) (bool, error)

	// Delete removes the data for a given ID.
	// It can also optionally remove empty parent directories.
	Delete(id string) error

	// GetPath returns the full file path for a given ID without accessing the file.
	GetPath(id string) (string, error)
}

ShardedStorage defines the interface for a storage system that stores data in a sharded directory structure based on an ID.

Jump to

Keyboard shortcuts

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