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

Method HasWithContext

shared_state.go:237–253  ·  shared_state.go::SharedState.HasWithContext
(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

235}
236
237func (s *SharedState) HasWithContext(ctx context.Context, key string) (bool, error) {
238 if err := s.ensureStorage(); err != nil {
239 return false, err
240 }
241
242 storageKey, ok := s.storageKey(key)
243 if !ok {
244 return false, nil
245 }
246
247 data, err := s.storage.GetWithContext(ctx, storageKey)
248 if err != nil {
249 return false, err
250 }
251
252 return data != nil, nil
253}
254
255func (s *SharedState) Reset() error {
256 return s.ResetWithContext(context.Background())

Callers 2

HasMethod · 0.95

Calls 3

ensureStorageMethod · 0.95
storageKeyMethod · 0.95
GetWithContextMethod · 0.65

Tested by 1