memory

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 7 Imported by: 0

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

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

Get retrieves metadata for a content

func (*ContentMetadataRepository) Set

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) Create

func (r *ContentRepository) Create(ctx context.Context, content *domain.Content) error

Create adds a new content to the repository

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) Delete

func (r *ContentRepository) Delete(ctx context.Context, id uuid.UUID) error

Delete removes a content by ID

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) Get

Get retrieves a content by ID

func (*ContentRepository) GetDerivedContentByLevel added in v0.0.12

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

ListDerivedContent retrieves derived content based on the provided parameters

func (*ContentRepository) Update

func (r *ContentRepository) Update(ctx context.Context, content *domain.Content) error

Update updates an existing content

type ObjectMetadataRepository

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

ObjectMetadataRepository is an in-memory implementation of the ObjectMetadataRepository interface

func (*ObjectMetadataRepository) Get

Get retrieves metadata for an object

func (*ObjectMetadataRepository) Set

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) Create

func (r *ObjectRepository) Create(ctx context.Context, object *domain.Object) error

Create adds a new object to the repository

func (*ObjectRepository) Delete

func (r *ObjectRepository) Delete(ctx context.Context, id uuid.UUID) error

Delete removes an object by ID

func (*ObjectRepository) Get

Get retrieves an object by ID

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

func (*ObjectRepository) Update

func (r *ObjectRepository) Update(ctx context.Context, object *domain.Object) error

Update updates an existing object

type StorageBackendRepository

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

StorageBackendRepository is an in-memory implementation of the StorageBackendRepository interface

func (*StorageBackendRepository) Create

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

Get retrieves a storage backend by name

func (*StorageBackendRepository) List

List retrieves all storage backends

func (*StorageBackendRepository) Update

Update updates an existing storage backend

Jump to

Keyboard shortcuts

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