CELLibrary produces options that expose this matcher for use in CEL expression matchers. Example: expression method('PUT', 'POST')
(_ caddy.Context)
| 815 | // |
| 816 | // expression method('PUT', 'POST') |
| 817 | func (MatchMethod) CELLibrary(_ caddy.Context) (cel.Library, error) { |
| 818 | return CELMatcherImpl( |
| 819 | "method", |
| 820 | "method_request_list", |
| 821 | []*cel.Type{cel.ListType(cel.StringType)}, |
| 822 | func(data ref.Val) (RequestMatcherWithError, error) { |
| 823 | refStringList := stringSliceType |
| 824 | strList, err := data.ConvertToNative(refStringList) |
| 825 | if err != nil { |
| 826 | return nil, err |
| 827 | } |
| 828 | return MatchMethod(strList.([]string)), nil |
| 829 | }, |
| 830 | ) |
| 831 | } |
| 832 | |
| 833 | // CaddyModule returns the Caddy module information. |
| 834 | func (MatchQuery) CaddyModule() caddy.ModuleInfo { |
nothing calls this directly
no test coverage detected