func toUris()

in pkg/adapter/route.go [38:62]


func toUris(r *mem.Route) []*string {
	result := make([]*string, 0)
	for _, m := range r.Match {
		// uris
		matchUris := m["uris"]
		switch reflect.TypeOf(matchUris).Kind() {
		case reflect.Slice:
			s := reflect.ValueOf(matchUris)
			if slice, ok := s.Interface().([]map[string]string); ok {
				for _, s := range slice {
					for k, v := range s {
						switch k {
						case "prefix":
							uri := v + "*"
							result = append(result, &uri)
						case "exact":
							result = append(result, &v)
						}
					}
				}
			}
		}
	}
	return result
}