feat: add bounded observability and verified SLO incident alerts

This commit is contained in:
Vladislav Agapov
2026-10-29 18:01:11 +03:00
parent 470d9d6f1e
commit 6c7601802d
325 changed files with 24988 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/mtusi2026lab6/internal/service"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/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
}