MCPcopy
hub / github.com/EverythingSuckz/TG-FileStreamBot / Set

Method Set

internal/cache/cache.go:50–61  ·  view source on GitHub ↗
(key string, value *types.File, expireSeconds int)

Source from the content-addressed store, hash-verified

48}
49
50func (c *Cache) Set(key string, value *types.File, expireSeconds int) error {
51 c.mu.Lock()
52 defer c.mu.Unlock()
53 var buf bytes.Buffer
54 enc := gob.NewEncoder(&buf)
55 err := enc.Encode(value)
56 if err != nil {
57 return err
58 }
59 cache.cache.Set([]byte(key), buf.Bytes(), expireSeconds)
60 return nil
61}
62
63func (c *Cache) Delete(key string) error {
64 c.mu.Lock()

Callers 2

FileFromMessageFunction · 0.80
setupEnvVarsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected