Skip to content

Commit

Permalink
Merge pull request #115 from kaytu-io/fix-query-map-param
Browse files Browse the repository at this point in the history
Fix query map param
  • Loading branch information
artaasadi authored Sep 13, 2024
2 parents fe14934 + 2888f04 commit 4519f2a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/httpserver/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ func QueryArrayParam(ctx echo.Context, paramName string) []string {
return values
}

func QueryMapParam(ctx echo.Context, paramName string) map[string][]string {
mapParam := make(map[string][]string)
for key, values := range ctx.QueryParams() {
if strings.HasPrefix(key, fmt.Sprintf("%s[", paramName)) && strings.HasSuffix(key, "]") {
tagKey := key[len(fmt.Sprintf("%s[", paramName)) : len(key)-1]
mapParam[tagKey] = values
}
}
return mapParam
}

func initTracer() (*sdktrace.TracerProvider, error) {
exporter, err := jaeger.New(jaeger.WithAgentEndpoint(jaeger.WithAgentHost(agentHost)))
if err != nil {
Expand Down

0 comments on commit 4519f2a

Please sign in to comment.