MCPcopy
hub / github.com/gofiber/fiber / SetWithContext

Method SetWithContext

middleware/cache/cache_test.go:150–158  ·  view source on GitHub ↗
(_ context.Context, key string, val []byte, _ time.Duration)

Source from the content-addressed store, hash-verified

148}
149
150func (s *failingCacheStorage) SetWithContext(_ context.Context, key string, val []byte, _ time.Duration) error {
151 s.mu.Lock()
152 defer s.mu.Unlock()
153 if err, ok := s.errs["set|"+key]; ok && err != nil {
154 return err
155 }
156 s.data[key] = append([]byte(nil), val...)
157 return nil
158}
159
160func (s *failingCacheStorage) Set(key string, val []byte, exp time.Duration) error {
161 return s.SetWithContext(context.Background(), key, val, exp)

Callers 1

SetMethod · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected