*app) GenerateCacheKey(moduleName string, attributes map[string]string) string { // features var features []string switch moduleName { case "moduleA": features = []string{attributes["age"], attributes["gender"]} case "moduleB": features = []string{attributes["lastWatchedEpisodeId"]} case "moduleC": features = []string{attributes["paymentStatus"]} } // hash hash := xxhash.New() for i := range features { _, _ = hash.WriteString(features[i]) } return hex.EncodeToString(hash.Sum(nil)) }