MCPcopy
hub / github.com/caddyserver/caddy / NativeToValue

Method NativeToValue

modules/caddyhttp/celmatcher.go:349–361  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

347type celTypeAdapter struct{}
348
349func (celTypeAdapter) NativeToValue(value any) ref.Val {
350 switch v := value.(type) {
351 case celHTTPRequest:
352 return v
353 case pkix.Name:
354 return celPkixName{&v}
355 case time.Time:
356 return types.Timestamp{Time: v}
357 case error:
358 return types.WrapErr(v)
359 }
360 return types.DefaultTypeAdapter.NativeToValue(value)
361}
362
363// CELLibraryProducer provide CEL libraries that expose a Matcher
364// implementation as a first class function within the CEL expression

Callers 1

caddyPlaceholderFuncMethod · 0.80

Calls 1

WrapErrMethod · 0.80

Tested by

no test coverage detected