Documentation
¶
Overview ¶
Deprecated: This package is deprecated as of 2025-10-01 and will be removed in 3 months. Please migrate to github.com/tendant/simple-content/pkg/simplecontent/repo/memory which provides:
- Unified Repository interface
- Better error handling
- Status management operations
- Soft delete support
See MIGRATION_FROM_LEGACY.md for migration guide.
Deprecated: This package is deprecated as of 2025-10-01 and will be removed in 3 months. Please migrate to github.com/tendant/simple-content/pkg/simplecontent/repo/memory which provides:
- Unified Repository interface
- Better error handling
- Status management operations
- Soft delete support
See MIGRATION_FROM_LEGACY.md for migration guide.
Deprecated: This package is deprecated as of 2025-10-01 and will be removed in 3 months. Please migrate to github.com/tendant/simple-content/pkg/simplecontent/repo/memory which provides:
- Unified Repository interface
- Better error handling
- Status management operations
- Soft delete support
See MIGRATION_FROM_LEGACY.md for migration guide.
Deprecated: This package is deprecated as of 2025-10-01 and will be removed in 3 months. Please migrate to github.com/tendant/simple-content/pkg/simplecontent/repo/memory which provides:
- Unified Repository interface
- Better error handling
- Status management operations
- Soft delete support
See MIGRATION_FROM_LEGACY.md for migration guide.
Deprecated: This package is deprecated as of 2025-10-01 and will be removed in 3 months. Please migrate to github.com/tendant/simple-content/pkg/simplecontent/repo/memory which provides:
- Unified Repository interface
- Better error handling
- Status management operations
- Soft delete support
See MIGRATION_FROM_LEGACY.md for migration guide.
Index ¶
- func NewContentMetadataRepository() repository.ContentMetadataRepository
- func NewContentRepository() repository.ContentRepository
- func NewObjectMetadataRepository() repository.ObjectMetadataRepository
- func NewObjectRepository() repository.ObjectRepository
- func NewStorageBackendRepository() repository.StorageBackendRepository
- type ContentMetadataRepository
- type ContentRepository
- func (r *ContentRepository) Create(ctx context.Context, content *domain.Content) error
- func (r *ContentRepository) CreateDerivedContentRelationship(ctx context.Context, params repository.CreateDerivedContentParams) (domain.DerivedContent, error)
- func (r *ContentRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (r *ContentRepository) DeleteDerivedContentRelationship(ctx context.Context, params repository.DeleteDerivedContentParams) error
- func (r *ContentRepository) Get(ctx context.Context, id uuid.UUID) (*domain.Content, error)
- func (r *ContentRepository) GetDerivedContentByLevel(ctx context.Context, params repository.GetDerivedContentByLevelParams) ([]repository.ContentWithParent, error)
- func (r *ContentRepository) GetDerivedContentTree(ctx context.Context, rootID uuid.UUID, maxDepth int) ([]*domain.Content, error)
- func (r *ContentRepository) List(ctx context.Context, ownerID, tenantID uuid.UUID) ([]*domain.Content, error)
- func (r *ContentRepository) ListDerivedContent(ctx context.Context, params repository.ListDerivedContentParams) ([]*domain.DerivedContent, error)
- func (r *ContentRepository) Update(ctx context.Context, content *domain.Content) error
- type ObjectMetadataRepository
- type ObjectRepository
- func (r *ObjectRepository) Create(ctx context.Context, object *domain.Object) error
- func (r *ObjectRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (r *ObjectRepository) Get(ctx context.Context, id uuid.UUID) (*domain.Object, error)
- func (r *ObjectRepository) GetByContentID(ctx context.Context, contentID uuid.UUID) ([]*domain.Object, error)
- func (r *ObjectRepository) GetByObjectKeyAndStorageBackendName(ctx context.Context, objectKey string, storageBackendName string) (*domain.Object, error)
- func (r *ObjectRepository) Update(ctx context.Context, object *domain.Object) error
- type StorageBackendRepository
- func (r *StorageBackendRepository) Create(ctx context.Context, backend *domain.StorageBackend) error
- func (r *StorageBackendRepository) Delete(ctx context.Context, name string) error
- func (r *StorageBackendRepository) Get(ctx context.Context, name string) (*domain.StorageBackend, error)
- func (r *StorageBackendRepository) List(ctx context.Context) ([]*domain.StorageBackend, error)
- func (r *StorageBackendRepository) Update(ctx context.Context, backend *domain.StorageBackend) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContentMetadataRepository ¶
func NewContentMetadataRepository() repository.ContentMetadataRepository
NewContentMetadataRepository creates a new in-memory content metadata repository
func NewContentRepository ¶
func NewContentRepository() repository.ContentRepository
NewContentRepository creates a new in-memory content repository
func NewObjectMetadataRepository ¶
func NewObjectMetadataRepository() repository.ObjectMetadataRepository
NewObjectMetadataRepository creates a new in-memory object metadata repository
func NewObjectRepository ¶
func NewObjectRepository() repository.ObjectRepository
NewObjectRepository creates a new in-memory object repository
func NewStorageBackendRepository ¶
func NewStorageBackendRepository() repository.StorageBackendRepository
NewStorageBackendRepository creates a new in-memory storage backend repository
Types ¶
type ContentMetadataRepository ¶
type ContentMetadataRepository struct {
// contains filtered or unexported fields
}
ContentMetadataRepository is an in-memory implementation of the ContentMetadataRepository interface
func (*ContentMetadataRepository) Get ¶
func (r *ContentMetadataRepository) Get(ctx context.Context, contentID uuid.UUID) (*domain.ContentMetadata, error)
Get retrieves metadata for a content
func (*ContentMetadataRepository) Set ¶
func (r *ContentMetadataRepository) Set(ctx context.Context, metadata *domain.ContentMetadata) error
Set sets metadata for a content
type ContentRepository ¶
type ContentRepository struct {
// contains filtered or unexported fields
}
ContentRepository is an in-memory implementation of the ContentRepository interface
func (*ContentRepository) CreateDerivedContentRelationship ¶ added in v0.0.12
func (r *ContentRepository) CreateDerivedContentRelationship(ctx context.Context, params repository.CreateDerivedContentParams) (domain.DerivedContent, error)
CreateDerivedContentRelationship creates a new derived content relationship
func (*ContentRepository) DeleteDerivedContentRelationship ¶ added in v0.0.12
func (r *ContentRepository) DeleteDerivedContentRelationship(ctx context.Context, params repository.DeleteDerivedContentParams) error
DeleteDerivedContent deletes a derived content
func (*ContentRepository) GetDerivedContentByLevel ¶ added in v0.0.12
func (r *ContentRepository) GetDerivedContentByLevel(ctx context.Context, params repository.GetDerivedContentByLevelParams) ([]repository.ContentWithParent, error)
GetDerivedContentByLevel retrieves derived content at a specific level with parent information
func (*ContentRepository) GetDerivedContentTree ¶
func (r *ContentRepository) GetDerivedContentTree(ctx context.Context, rootID uuid.UUID, maxDepth int) ([]*domain.Content, error)
GetDerivedContentTree retrieves the entire tree of derived content up to maxDepth Note: This method is now a stub as ParentID has been removed from Content struct The relationship between content items is now tracked in ContentDerived table
func (*ContentRepository) List ¶
func (r *ContentRepository) List(ctx context.Context, ownerID, tenantID uuid.UUID) ([]*domain.Content, error)
List retrieves contents by owner ID and tenant ID
func (*ContentRepository) ListDerivedContent ¶
func (r *ContentRepository) ListDerivedContent(ctx context.Context, params repository.ListDerivedContentParams) ([]*domain.DerivedContent, error)
ListDerivedContent retrieves derived content based on the provided parameters
type ObjectMetadataRepository ¶
type ObjectMetadataRepository struct {
// contains filtered or unexported fields
}
ObjectMetadataRepository is an in-memory implementation of the ObjectMetadataRepository interface
func (*ObjectMetadataRepository) Get ¶
func (r *ObjectMetadataRepository) Get(ctx context.Context, objectID uuid.UUID) (*domain.ObjectMetadata, error)
Get retrieves metadata for an object
func (*ObjectMetadataRepository) Set ¶
func (r *ObjectMetadataRepository) Set(ctx context.Context, metadata *domain.ObjectMetadata) error
Set sets metadata for an object
type ObjectRepository ¶
type ObjectRepository struct {
// contains filtered or unexported fields
}
ObjectRepository is an in-memory implementation of the ObjectRepository interface
func (*ObjectRepository) GetByContentID ¶
func (r *ObjectRepository) GetByContentID(ctx context.Context, contentID uuid.UUID) ([]*domain.Object, error)
GetByContentID retrieves objects by content ID
func (*ObjectRepository) GetByObjectKeyAndStorageBackendName ¶ added in v0.0.8
func (r *ObjectRepository) GetByObjectKeyAndStorageBackendName(ctx context.Context, objectKey string, storageBackendName string) (*domain.Object, error)
GetByObjectKeyAndStorageBackend retrieves a non-deleted object by object key and storage backend name
type StorageBackendRepository ¶
type StorageBackendRepository struct {
// contains filtered or unexported fields
}
StorageBackendRepository is an in-memory implementation of the StorageBackendRepository interface
func (*StorageBackendRepository) Create ¶
func (r *StorageBackendRepository) Create(ctx context.Context, backend *domain.StorageBackend) error
Create adds a new storage backend to the repository
func (*StorageBackendRepository) Delete ¶
func (r *StorageBackendRepository) Delete(ctx context.Context, name string) error
Delete removes a storage backend by name
func (*StorageBackendRepository) Get ¶
func (r *StorageBackendRepository) Get(ctx context.Context, name string) (*domain.StorageBackend, error)
Get retrieves a storage backend by name
func (*StorageBackendRepository) List ¶
func (r *StorageBackendRepository) List(ctx context.Context) ([]*domain.StorageBackend, error)
List retrieves all storage backends
func (*StorageBackendRepository) Update ¶
func (r *StorageBackendRepository) Update(ctx context.Context, backend *domain.StorageBackend) error
Update updates an existing storage backend