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

Method GetJSONWithContext

shared_state.go:136–142  ·  view source on GitHub ↗
(ctx context.Context, key string, out any)

Source from the content-addressed store, hash-verified

134}
135
136func (s *SharedState) GetJSONWithContext(ctx context.Context, key string, out any) ([]byte, bool, error) { //nolint:gocritic // Keep unnamed returns for clarity.
137 if err := s.ensureStorage(); err != nil {
138 return nil, false, err
139 }
140
141 return s.getEncodedWithContext(ctx, key, out, s.jsonDecoder, "json")
142}
143
144func (s *SharedState) SetMsgPack(key string, v any, ttl time.Duration) error {
145 return s.SetMsgPackWithContext(context.Background(), key, v, ttl)

Callers 2

GetJSONMethod · 0.95

Calls 2

ensureStorageMethod · 0.95
getEncodedWithContextMethod · 0.95

Tested by 1