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
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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. }