CacheKeys.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. namespace Application.Abstractions.Cache;
  2. public static class CacheKeys
  3. {
  4. public const string Config = "config";
  5. public const string FaqCategoryActive = "faq:category:active";
  6. public const string PopupPositionActive = "popup:position:active";
  7. public static string FaqItemByCode(string code) => $"faq:item:{code}";
  8. public static string PopupByCode(string code) => $"popup:{code}";
  9. public static string BannerByCode(string code) => $"banner:{code}";
  10. public static string DocumentByCode(string code) => $"document:{code}";
  11. public static string BoardMeta(int boardID) => $"board:meta:{boardID}";
  12. public const string CryptoCategoryActive = "crypto:category:active";
  13. public static string CoinBySymbol(string symbol) => $"crypto:coin:{symbol.ToLower()}";
  14. // Crypto Ticker (market = "KRW-BTC" 형식)
  15. public static string CryptoTickers(string quote) => $"crypto:tickers:{quote.ToLower()}";
  16. public static string CryptoTicker(string market) => $"crypto:ticker:{market.ToLower()}";
  17. public static string CryptoCandle(string market, string type) => $"crypto:candle:{market.ToLower()}:{type}";
  18. // Crypto REST (초기 로딩용)
  19. public const string CryptoMarkets = "crypto:markets";
  20. public static string CryptoTickerDetail(string market) => $"crypto:ticker:detail:{market.ToLower()}";
  21. public static string CryptoTrades(string market) => $"crypto:trades:{market.ToLower()}";
  22. public static string CryptoOrderbook(string market) => $"crypto:orderbook:{market.ToLower()}";
  23. // Crypto WebSocket Live (실시간용)
  24. public static string CryptoCandleLive(string market, string interval) => $"crypto:candle:live:{market.ToLower()}:{interval}";
  25. public static string CryptoTradeLive(string market) => $"crypto:trade:live:{market.ToLower()}";
  26. public static string CryptoOrderbookLive(string market) => $"crypto:orderbook:live:{market.ToLower()}";
  27. // Chat
  28. public const string ChatGlobalMessages = "chat:global:messages";
  29. public const string ChatConnections = "chat:connections"; // Hash — 실시간 접속자
  30. public const string ChatKickChannel = "chat:kick"; // Pub/Sub — 강제 퇴장
  31. // YouTube
  32. public static string YouTubeChannel(string channelId) => $"youtube:channel:{channelId}";
  33. public static string YouTubeLiveStream(string videoId) => $"youtube:live:{videoId}";
  34. public const string YouTubePubSubChannels = "youtube:pubsub:channels"; // Set — 구독 중인 채널 ID
  35. }