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

Method SetWithContext

shared_state.go:80–91  ·  shared_state.go::SharedState.SetWithContext
(ctx context.Context, key string, val []byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

78}
79
80func (s *SharedState) SetWithContext(ctx context.Context, key string, val []byte, ttl time.Duration) error {
81 if err := s.ensureStorage(); err != nil {
82 return err
83 }
84
85 storageKey, ok := s.storageKey(key)
86 if !ok {
87 return nil
88 }
89
90 return s.storage.SetWithContext(ctx, storageKey, val, ttl)
91}
92
93func (s *SharedState) Get(key string) ([]byte, bool, error) { //nolint:gocritic // Keep unnamed returns for clarity.
94 return s.GetWithContext(context.Background(), key)

Callers 1

SetMethod · 0.95

Calls 3

ensureStorageMethod · 0.95
storageKeyMethod · 0.95
SetWithContextMethod · 0.65

Tested by

no test coverage detected