NewMessageCache() initializes and returns a new MessageCache instance
()
| 249 | |
| 250 | // NewMessageCache() initializes and returns a new MessageCache instance |
| 251 | func NewMessageCache() *MessageCache { |
| 252 | return &MessageCache{ |
| 253 | queue: list.New(), |
| 254 | deDupe: NewDeDuplicator[string](), |
| 255 | maxSize: 10000, |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | // Add inserts a new message into the cache if it doesn't already exist |
| 260 | // It removes the oldest message if the cache is full |
no test coverage detected