Files
warmbly/internal/app/cipher/service.go
T
2026-01-17 14:11:14 +00:00

29 lines
808 B
Go

package cipher
import (
"context"
"github.com/google/uuid"
"github.com/warmbly/warmbly/internal/infrastructure/cache"
"github.com/warmbly/warmbly/internal/infrastructure/kms"
"github.com/warmbly/warmbly/internal/repository"
)
type CipherService interface {
Cipher(ctx context.Context, userID uuid.UUID) (*Cipher, error)
}
type cipherService struct {
userEncryptedKeysRepository repository.UserEncryptedKeysRepository
cache *cache.Cache
kms *kms.KMS
}
func NewService(kms *kms.KMS, cache *cache.Cache, userEncryptedKeysRepository repository.UserEncryptedKeysRepository) CipherService {
return &cipherService{
kms: kms,
cache: cache,
userEncryptedKeysRepository: userEncryptedKeysRepository,
}
}