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

Method SetWithContext

middleware/csrf/csrf_test.go:2603–2611  ·  view source on GitHub ↗
(_ context.Context, key string, val []byte, _ time.Duration)

Source from the content-addressed store, hash-verified

2601}
2602
2603func (s *flakySessionStorage) SetWithContext(_ context.Context, key string, val []byte, _ time.Duration) error {
2604 s.mu.Lock()
2605 defer s.mu.Unlock()
2606 if s.failSet {
2607 return errors.New("set failed")
2608 }
2609 s.data[key] = append([]byte(nil), val...)
2610 return nil
2611}
2612
2613func (s *flakySessionStorage) Set(key string, val []byte, exp time.Duration) error {
2614 return s.SetWithContext(context.Background(), key, val, exp)

Callers 1

SetMethod · 0.95

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected