Documentation
¶
Overview ¶
Package meta implements the functions, types, and interfaces for the module.
Package meta implements the functions, types, and interfaces for the module.
Package meta implements the functions, types, and interfaces for the module.
Index ¶
- func MarshalFileMeta(meta metaiface.FileMeta) ([]byte, error)
- func Unmarshal(data []byte) (meta.FileMeta, error)
- func UnmarshalFileMeta(data []byte) (meta.FileMeta, error)
- type Service
- type Store
- func (s *Store) Create(id string, fileMeta metaiface.FileMeta) error
- func (s *Store) CurrentVersion() int
- func (s *Store) Delete(id string) error
- func (s *Store) Exists(embedded string) (bool, error)
- func (s *Store) Get(id string) (metaiface.FileMeta, error)
- func (s *Store) Migrate(id string) (metaiface.FileMeta, error)
- func (s *Store) Update(id string, fileMeta metaiface.FileMeta) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a high-level service for managing file content and its metadata. It orchestrates interactions between the metadata store (metaStore) and the blob store (blobStore). It is stateless and operates on content IDs (metaID), not paths.
func NewService ¶
func NewService(metaStore metaiface.Store, basePath string, assembler contentiface.Assembler, chunkSize int64) (*Service, error)
NewService creates a new Service instance.
func (*Service) Create ¶
Create reads content from a reader, stores it (either embedded or as sharded blobs), persists the metadata, and returns the unique metadata ID. It optimizes based on whether the input `size` is known.
func (*Service) Delete ¶
Delete orchestrates the deletion of file content (blobs) and the metadata record.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the metaiface.Store interface using the local filesystem. It relies on a ShardedStorage layout to manage the physical files.
func (*Store) Create ¶
Create serializes the FileMeta and stores it using a pre-determined, content-derived ID. The caller is responsible for generating the correct ID.
func (*Store) CurrentVersion ¶
CurrentVersion returns the version number used for writing new metadata. The system maintains backward compatibility for reading older, supported versions.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package metav1 implements the functions, types, and interfaces for the module.
|
Package metav1 implements the functions, types, and interfaces for the module. |
|
Package metav2 implements the functions, types, and interfaces for the module.
|
Package metav2 implements the functions, types, and interfaces for the module. |