udpnat2: Add cache funcs

This commit is contained in:
世界 2024-11-18 12:14:35 +08:00
parent fdca9b3f8e
commit 30fbafd954
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -98,6 +98,20 @@ func (s *Service) NewPacket(bufferSlices [][]byte, source M.Socksaddr, destinati
}
}
func (s *Service) Purge() {
s.cache.Purge()
}
func (s *Service) PurgeExpired() {
s.cache.PurgeExpired()
}
func (s *Service) Metrics() Metrics {
return s.metrics
}
func (s *Service) ResetMetrics() Metrics {
metrics := s.metrics
s.metrics = Metrics{}
return metrics
}