Documentation
¶
Index ¶
- type ContentService
- func (s *ContentService) CreateContent(ctx context.Context, ownerID, tenantID uuid.UUID) (*domain.Content, error)
- func (s *ContentService) CreateDerivedContent(ctx context.Context, parentID uuid.UUID, ownerID, tenantID uuid.UUID) (*domain.Content, error)
- func (s *ContentService) DeleteContent(ctx context.Context, id uuid.UUID) error
- func (s *ContentService) GetContent(ctx context.Context, id uuid.UUID) (*domain.Content, error)
- func (s *ContentService) GetContentMetadata(ctx context.Context, contentID uuid.UUID) (*domain.ContentMetadata, error)
- func (s *ContentService) ListContents(ctx context.Context, ownerID, tenantID uuid.UUID) ([]*domain.Content, error)
- func (s *ContentService) SetContentMetadata(ctx context.Context, contentID uuid.UUID, ...) error
- func (s *ContentService) UpdateContent(ctx context.Context, content *domain.Content) error
- type ObjectService
- func (s *ObjectService) CreateObject(ctx context.Context, contentID uuid.UUID, storageBackendName string, ...) (*domain.Object, error)
- func (s *ObjectService) DeleteObject(ctx context.Context, id uuid.UUID) error
- func (s *ObjectService) DownloadObject(ctx context.Context, id uuid.UUID) (io.ReadCloser, error)
- func (s *ObjectService) GetBackend(name string) (storage.Backend, error)
- func (s *ObjectService) GetDownloadURL(ctx context.Context, id uuid.UUID) (string, error)
- func (s *ObjectService) GetObject(ctx context.Context, id uuid.UUID) (*domain.Object, error)
- func (s *ObjectService) GetObjectMetadata(ctx context.Context, objectID uuid.UUID) (map[string]interface{}, error)
- func (s *ObjectService) GetObjectsByContentID(ctx context.Context, contentID uuid.UUID) ([]*domain.Object, error)
- func (s *ObjectService) GetUploadURL(ctx context.Context, id uuid.UUID) (string, error)
- func (s *ObjectService) RegisterBackend(name string, backend storage.Backend)
- func (s *ObjectService) SetObjectMetadata(ctx context.Context, objectID uuid.UUID, metadata map[string]interface{}) error
- func (s *ObjectService) UpdateObject(ctx context.Context, object *domain.Object) error
- func (s *ObjectService) UploadObject(ctx context.Context, id uuid.UUID, reader io.Reader) error
- type StorageBackendService
- func (s *StorageBackendService) CreateStorageBackend(ctx context.Context, name string, backendType string, ...) (*domain.StorageBackend, error)
- func (s *StorageBackendService) DeleteStorageBackend(ctx context.Context, name string) error
- func (s *StorageBackendService) GetStorageBackend(ctx context.Context, name string) (*domain.StorageBackend, error)
- func (s *StorageBackendService) ListStorageBackends(ctx context.Context) ([]*domain.StorageBackend, error)
- func (s *StorageBackendService) UpdateStorageBackend(ctx context.Context, backend *domain.StorageBackend) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentService ¶
type ContentService struct {
// contains filtered or unexported fields
}
ContentService handles content-related operations
func NewContentService ¶
func NewContentService( contentRepo repository.ContentRepository, metadataRepo repository.ContentMetadataRepository, objectRepo repository.ObjectRepository, ) *ContentService
NewContentService creates a new content service
func (*ContentService) CreateContent ¶
func (s *ContentService) CreateContent( ctx context.Context, ownerID, tenantID uuid.UUID, ) (*domain.Content, error)
CreateContent creates a new original content
func (*ContentService) CreateDerivedContent ¶
func (s *ContentService) CreateDerivedContent( ctx context.Context, parentID uuid.UUID, ownerID, tenantID uuid.UUID, ) (*domain.Content, error)
CreateDerivedContent creates a new content derived from an existing content
func (*ContentService) DeleteContent ¶
DeleteContent deletes a content
func (*ContentService) GetContent ¶
GetContent retrieves a content by ID
func (*ContentService) GetContentMetadata ¶
func (s *ContentService) GetContentMetadata(ctx context.Context, contentID uuid.UUID) (*domain.ContentMetadata, error)
GetContentMetadata retrieves metadata for a content
func (*ContentService) ListContents ¶
func (s *ContentService) ListContents(ctx context.Context, ownerID, tenantID uuid.UUID) ([]*domain.Content, error)
ListContents lists contents by owner ID and tenant ID
func (*ContentService) SetContentMetadata ¶
func (s *ContentService) SetContentMetadata( ctx context.Context, contentID uuid.UUID, contentType, title, description string, tags []string, fileSize int64, createdBy string, customMetadata map[string]interface{}, ) error
SetContentMetadata sets metadata for a content
func (*ContentService) UpdateContent ¶
UpdateContent updates a content
type ObjectService ¶
type ObjectService struct {
// contains filtered or unexported fields
}
ObjectService handles object-related operations
func NewObjectService ¶
func NewObjectService( objectRepo repository.ObjectRepository, objectMetadataRepo repository.ObjectMetadataRepository, storageBackendRepo repository.StorageBackendRepository, defaultBackend storage.Backend, ) *ObjectService
NewObjectService creates a new object service
func (*ObjectService) CreateObject ¶
func (s *ObjectService) CreateObject( ctx context.Context, contentID uuid.UUID, storageBackendName string, version int, ) (*domain.Object, error)
CreateObject creates a new object
func (*ObjectService) DeleteObject ¶
DeleteObject deletes an object
func (*ObjectService) DownloadObject ¶
func (s *ObjectService) DownloadObject(ctx context.Context, id uuid.UUID) (io.ReadCloser, error)
DownloadObject downloads an object
func (*ObjectService) GetBackend ¶
func (s *ObjectService) GetBackend(name string) (storage.Backend, error)
GetBackend returns a storage backend by name
func (*ObjectService) GetDownloadURL ¶
GetDownloadURL gets a URL for downloading an object
func (*ObjectService) GetObjectMetadata ¶
func (s *ObjectService) GetObjectMetadata(ctx context.Context, objectID uuid.UUID) (map[string]interface{}, error)
GetObjectMetadata retrieves metadata for an object
func (*ObjectService) GetObjectsByContentID ¶
func (s *ObjectService) GetObjectsByContentID(ctx context.Context, contentID uuid.UUID) ([]*domain.Object, error)
GetObjectsByContentID retrieves objects by content ID
func (*ObjectService) GetUploadURL ¶
GetUploadURL gets a URL for uploading an object
func (*ObjectService) RegisterBackend ¶
func (s *ObjectService) RegisterBackend(name string, backend storage.Backend)
RegisterBackend registers a storage backend
func (*ObjectService) SetObjectMetadata ¶
func (s *ObjectService) SetObjectMetadata(ctx context.Context, objectID uuid.UUID, metadata map[string]interface{}) error
SetObjectMetadata sets metadata for an object
func (*ObjectService) UpdateObject ¶
UpdateObject updates an object
func (*ObjectService) UploadObject ¶
UploadObject uploads an object
type StorageBackendService ¶
type StorageBackendService struct {
// contains filtered or unexported fields
}
StorageBackendService handles storage backend operations
func NewStorageBackendService ¶
func NewStorageBackendService( storageBackendRepo repository.StorageBackendRepository, ) *StorageBackendService
NewStorageBackendService creates a new storage backend service
func (*StorageBackendService) CreateStorageBackend ¶
func (s *StorageBackendService) CreateStorageBackend( ctx context.Context, name string, backendType string, config map[string]interface{}, ) (*domain.StorageBackend, error)
CreateStorageBackend creates a new storage backend
func (*StorageBackendService) DeleteStorageBackend ¶
func (s *StorageBackendService) DeleteStorageBackend(ctx context.Context, name string) error
DeleteStorageBackend deletes a storage backend
func (*StorageBackendService) GetStorageBackend ¶
func (s *StorageBackendService) GetStorageBackend(ctx context.Context, name string) (*domain.StorageBackend, error)
GetStorageBackend retrieves a storage backend by name
func (*StorageBackendService) ListStorageBackends ¶
func (s *StorageBackendService) ListStorageBackends(ctx context.Context) ([]*domain.StorageBackend, error)
ListStorageBackends lists all storage backends
func (*StorageBackendService) UpdateStorageBackend ¶
func (s *StorageBackendService) UpdateStorageBackend(ctx context.Context, backend *domain.StorageBackend) error
UpdateStorageBackend updates a storage backend