lab5: асинхронная очередь, worker и идемпотентный pipeline

API принимает 202 после durable staging и TX intent (job+outbox); отдельные relay и worker публикуют/обрабатывают задания с publisher confirm, lease, retry/backoff, DLQ и replay. Добавлены версии pipeline, варианты thumbnail/crop/optimized, presign в verified staging, status-aware sweeper и admission control.
This commit is contained in:
Vladislav Kunetskiy
2026-10-30 22:36:52 +03:00
parent 6c5ba026f1
commit 4bdcac3dfa
95 changed files with 8466 additions and 764 deletions
@@ -22,6 +22,8 @@ type Object struct {
// because AWS SigV4 may need to rewind the payload; the proxy upload path always
// passes an *os.File.
type Store interface {
// Ping verifies that the bucket is reachable and the credentials are valid.
Ping(ctx context.Context) error
Put(ctx context.Context, key string, body io.ReadSeeker, size int64, contentType string, metadata map[string]string) error
Open(ctx context.Context, key string) (io.ReadCloser, Object, error)
Head(ctx context.Context, key string) (Object, error)
+13
View File
@@ -91,6 +91,19 @@ func New(cfg Config) (*S3, error) {
return st, nil
}
func (s *S3) Ping(ctx context.Context) error {
// HeadBucket needs bucket-level permissions that the application identity
// intentionally does not have. A HeadObject on a sentinel staging key is
// enough to prove connectivity and the object-level credentials; a missing
// sentinel is the expected healthy result.
_, err := s.Head(ctx, "staging/.health/ping")
if err == nil || errors.Is(err, domain.ErrNotFound) {
return nil
}
return err
}
func (s *S3) Put(
ctx context.Context,
key string,