Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

cache.go 295B

12345678910111213141516
  1. package antireplay
  2. import "github.com/allegro/bigcache"
  3. type cache struct {
  4. cache *bigcache.BigCache
  5. }
  6. func (c *cache) Add(data []byte) {
  7. c.cache.Set(string(data), nil) // nolint: errcheck
  8. }
  9. func (c *cache) Has(data []byte) bool {
  10. _, err := c.cache.Get(string(data))
  11. return err == nil
  12. }