feat: process attachments through durable versioned jobs

This commit is contained in:
Vladislav Agapov
2026-10-29 16:56:06 +03:00
parent 276dbdad8a
commit e35c8f0b75
235 changed files with 17028 additions and 44 deletions
+39
View File
@@ -0,0 +1,39 @@
// Package production implements the messenger application operations.
package production
import (
"fmt"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab5/internal/service"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab5/internal/store"
)
// Service orchestrates operations through storage and cursor interfaces.
type Service struct {
repo store.Interface
cursors service.CursorCodec
cache service.ProfileCache
}
var _ service.Service = (*Service)(nil)
// New creates an application service using explicitly supplied dependencies.
func New(repo store.Interface, cursors service.CursorCodec) (*Service, error) {
if repo == nil || cursors == nil {
return nil, fmt.Errorf("store and cursor codec are required")
}
return &Service{repo: repo, cursors: cursors}, nil
}
// NewCached builds the business service with optional immutable-profile caching.
func NewCached(repo store.Interface, cursors service.CursorCodec, cache service.ProfileCache) (*Service, error) {
instance, err := New(repo, cursors)
if err != nil {
return nil, err
}
if cache == nil {
return nil, fmt.Errorf("profile cache is required")
}
instance.cache = cache
return instance, nil
}