rdev/internal/port/cache_provisioner.go
jordan c59d348040 chore: prepare for composable monorepo template implementation
This commit captures the current state before implementing the composable
monorepo template system. Key changes included:

Infrastructure:
- Add CockroachDB provisioner adapter for database provisioning
- Add Redis provisioner adapter for cache provisioning
- Add build events system with PostgreSQL storage
- Add WebSocket endpoint for real-time build progress

Code agent improvements:
- Fix Claude Code adapter to use default allowed tools instead of dangerously-skip-permissions
- Add context-aware stream closing for cancellation support
- Improve parser tests for edge cases

Build system:
- Add build event constants and metrics
- Remove deprecated git_operations.go (replaced by pod_git_operations.go)
- Add rollback logic for multi-step provisioning operations

Documentation:
- Add composable-monorepo feature documentation
- Add DNS/Cloudflare service documentation
- Update deployment and troubleshooting guides

Cookbooks:
- Add fullstack-app cookbook
- Refactor landing-test with shared library

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 11:39:28 -07:00

28 lines
1.1 KiB
Go

package port
import (
"context"
"github.com/orchard9/rdev/internal/domain"
)
// CacheProvisioner provisions isolated cache access for projects.
// Implementation uses Redis ACLs to scope each project to its own key prefix.
type CacheProvisioner interface {
// CreateProjectCache provisions isolated cache access for a project.
// Creates a Redis ACL user scoped to the project's key prefix.
// Returns credentials that should be injected into the project's environment.
CreateProjectCache(ctx context.Context, projectID string) (*domain.CacheCredentials, error)
// DeleteProjectCache removes cache access for a project.
// Deletes the Redis ACL user and optionally purges all project keys.
DeleteProjectCache(ctx context.Context, projectID string, purgeKeys bool) error
// GetProjectCache retrieves cache credentials for a project.
// Returns nil if the project has no cache provisioned.
GetProjectCache(ctx context.Context, projectID string) (*domain.CacheCredentials, error)
// TestConnection verifies the cache provisioner can connect to Redis.
TestConnection(ctx context.Context) error
}