Files
2026-05-23 17:06:52 +08:00

26 lines
607 B
Go

package access
import (
"context"
"strings"
)
type closurePlan struct {
effectiveProbeAPIKey string
effectiveProbeKeySource string
}
func (s *Service) prepareClosurePlan(ctx context.Context, req ClosureRequest) (closurePlan, error) {
requestedProbeAPIKey := strings.TrimSpace(req.ProbeAPIKey)
plan := closurePlan{
effectiveProbeAPIKey: requestedProbeAPIKey,
}
if requestedProbeAPIKey != "" {
plan.effectiveProbeKeySource = ProbeKeySourceRequestedProbeAPIKey
}
if strings.TrimSpace(req.Mode) != ModeSubscription {
return plan, nil
}
return s.prepareSubscriptionPlan(ctx, req, plan)
}