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

Function contextRecordFrom

middleware/limiter/limiter_test.go:133–142  ·  view source on GitHub ↗
(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

131}
132
133func contextRecordFrom(ctx context.Context, key string) contextRecord {
134 record := contextRecord{
135 key: key,
136 canceled: errors.Is(ctx.Err(), context.Canceled),
137 }
138 if value, ok := ctx.Value(markerKey).(string); ok {
139 record.value = value
140 }
141 return record
142}
143
144func (s *contextRecorderLimiterStorage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
145 s.gets = append(s.gets, contextRecordFrom(ctx, key))

Callers 2

GetWithContextMethod · 0.70
SetWithContextMethod · 0.70

Calls 3

IsMethod · 0.65
ErrMethod · 0.65
ValueMethod · 0.65

Tested by

no test coverage detected