// ToMap returns a map from an array of HandlerName.
492631
func (hns HandlerNames) ToMap() map[string]*HandlerName {
	hnMap := make(map[string]*HandlerName)

	for _, nh := range hns {
		hnMap[nh.Name] = nh
	}

	return hnMap
}
128720
func (g *routeGroup) Handle(method string, path string, h ...Handler) {
	g.handle(method, path, h)
}
541762
func (p PinSliceBySubdir) ToMap() PinMapBySubdir {
	ret := make(PinMapBySubdir, len(p))
	for subdir, pkgs := range p {
		ret[subdir] = pkgs.ToMap()
	}
	return ret
}
427858
func (m *Message) toMap(pToken, rToken string) map[string]string {
	ret := map[string]string{
		"token":    pToken,
		"user":     rToken,
		"message":  m.Message,
		"priority": strconv.Itoa(m.Priority),
	}

	if m.Title != "" {
		ret["title"] = m.Title
	}

	if m.URL != "" {
		ret["url"] = m.URL
	}

	if m.URLTitle != "" {
		ret["url_title"] = m.URLTitle
	}

	if m.Sound != "" {
		ret["sound"] = m.Sound
	}

	if m.DeviceName != "" {
		ret["device"] = m.DeviceName
	}

	if m.Timestamp != 0 {
		ret["timestamp"] = strconv.FormatInt(m.Timestamp, 10)
	}

	if m.HTML {
		ret["html"] = "1"
	}

	if m.Priority == PriorityEmergency {
		ret["retry"] = strconv.FormatFloat(m.Retry.Seconds(), 'f', -1, 64)
		ret["expire"] = strconv.FormatFloat(m.Expire.Seconds(), 'f', -1, 64)
		if m.CallbackURL != "" {
			ret["callback"] = m.CallbackURL
		}
	}

	return ret
}
435513
func (mr *MockAccessResponderMockRecorder) ToMap() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ToMap", reflect.TypeOf((*MockAccessResponder)(nil).ToMap))
}
1214245
func ToMap(ctx context.Context) map[string]interface{} {
	if ctx == nil {
		return map[string]interface{}{}
	}
	p := ctx.Value(constants.PropagateCtxKey)
	if p != nil {
		return p.(map[string]interface{})
	}
	return map[string]interface{}{}
}
155684
func (f stringEqualsIgnoreCaseFunc) toMap() map[Key]ValueSet {
	if !f.k.IsValid() {
		return nil
	}

	values := NewValueSet()
	for _, value := range f.values.ToSlice() {
		values.Add(NewStringValue(value))
	}

	return map[Key]ValueSet{
		f.k: values,
	}
}
763201
func (l Labels) ToMap() map[ACIdentifier]string {
	labelsMap := make(map[ACIdentifier]string)
	for _, lbl := range l {
		labelsMap[lbl.Name] = lbl.Value
	}
	return labelsMap
}
372539
func (r *Router) Handle(method, path string, handlers []HandlerFunc) {
	handlers = r.combineHandlers(handlers)
	r.ace.httprouter.Handle(method, r.path(path), func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
		c := r.ace.createContext(w, req)
		c.params = params
		c.handlers = handlers
		c.Next()
		r.ace.pool.Put(c)
	})
}
610149
func httpHandlers(routes []*Route) map[string][]*Route {
	handlers := make(map[string][]*Route, len(validHTTPMethods))

	for _, validMethod := range validHTTPMethods {
		handlers[validMethod] = []*Route{}
	}

	for idx, route := range routes {
		found := false
		for _, validMethod := range validHTTPMethods {
			if route.Method == validMethod {
				found = true
				break
			}
		}

		if !found {
			LOGHANDLER.Fatal("Unsupported HTTP request method provided. Method:", route.Method)
			return nil
		}

		if route.Handlers == nil || len(route.Handlers) == 0 {
			LOGHANDLER.Fatal("No handlers provided for the route '", route.Pattern, "', method '", route.Method, "'")
			return nil
		}

		err := route.init()
		if err != nil {
			LOGHANDLER.Fatal("Unsupported URI pattern.", route.Pattern, err)
			return nil
		}

		checkDuplicateRoutes(idx, route, routes)

		handlers[route.Method] = append(handlers[route.Method], route)
	}

	return handlers
}
567481
func HandlerName(h interface{}) string {
	v := reflect.ValueOf(h)
	t := v.Type()
	if t.Kind() == reflect.Func {
		return runtime.FuncForPC(v.Pointer()).Name()
	}
	return t.String()
}
59067
func XMLToMap(r io.Reader) (map[string]string, error) {
	m := make(map[string]string)
	dec := xml.NewDecoder(r)
	var tagName string
	for {
		t, err := dec.Token()
		if err != nil {
			if err == io.EOF {
				break
			}
			return nil, err
		}

		switch v := t.(type) {
		case xml.StartElement:
			tagName = string(v.Name.Local)
		case xml.CharData:
			m[tagName] = string(v)
		}
	}
	return m, nil
}
412990
func configMap(configs []*config.PluginConfig) map[string]*config.PluginConfig {
	pluginMapping := make(map[string]*config.PluginConfig, len(configs))
	for _, c := range configs {
		pluginMapping[c.Name] = c
	}
	return pluginMapping
}
1165785
func toMap(object interface{}) (map[string]interface{}, error) {
	if m, ok := object.(map[string]interface{}); ok {
		return m, nil
	}
	data, err := json.Marshal(object)
	if err != nil {
		return nil, driver.WithStack(err)
	}
	var m map[string]interface{}
	if err := json.Unmarshal(data, &m); err != nil {
		return nil, driver.WithStack(err)
	}
	return m, nil
}
757583
func (k *Kite) HandleHTTP(pattern string, handler http.Handler) {
	k.muxer.Handle(pattern, handler)
}
1163177
func CSVToMap(in io.Reader) (map[string]string, error) {
	decoder := newDecoder(in)
	header, err := decoder.getCSVRow()
	if err != nil {
		return nil, err
	}
	if len(header) != 2 {
		return nil, fmt.Errorf("maps can only be created for csv of two columns")
	}
	m := make(map[string]string)
	for {
		line, err := decoder.getCSVRow()
		if err == io.EOF {
			break
		} else if err != nil {
			return nil, err
		}
		m[line[0]] = line[1]
	}
	return m, nil
}
252976
func (c *SyncCollector) ToMap() map[string]interface{} {
	var co Collector
	c.rw.RLock()
	co = c.c.Clone()
	c.rw.RUnlock()
	return co
}