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

Method SetCBORWithContext

shared_state.go:172–178  ·  view source on GitHub ↗
(ctx context.Context, key string, v any, ttl time.Duration)

Source from the content-addressed store, hash-verified

170}
171
172func (s *SharedState) SetCBORWithContext(ctx context.Context, key string, v any, ttl time.Duration) error {
173 if err := s.ensureStorage(); err != nil {
174 return err
175 }
176
177 return s.setEncodedWithContext(ctx, key, v, ttl, s.cborEncoder, "cbor")
178}
179
180func (s *SharedState) GetCBOR(key string, out any) ([]byte, bool, error) { //nolint:gocritic // Keep unnamed returns for clarity.
181 return s.GetCBORWithContext(context.Background(), key, out)

Callers 1

SetCBORMethod · 0.95

Calls 2

ensureStorageMethod · 0.95
setEncodedWithContextMethod · 0.95

Tested by

no test coverage detected