// MethodsFor returns all methods available for path
14526
func (r *router) MethodsFor(path string) []string {
	methods := []string{}
	for _, route := range r.getRoutes() {
		matches := route.regex.FindStringSubmatch(path)
		if len(matches) > 0 && matches[0] == path && !hasMethod(methods, route.method) {
			methods = append(methods, route.method)
		}
	}
	return methods
}
720421
func (d *API) OperationHandlerFor(method, path string) (runtime.OperationHandler, bool) {
	if d.operations == nil {
		return nil, false
	}
	if pi, ok := d.operations[strings.ToUpper(method)]; ok {
		h, ok := pi[path]
		return h, ok
	}
	return nil, false
}
904173
func (r *Route) Methods(methods []string, fn http.HandlerFunc) *Route {
	for _, method := range methods {
		r.Method(method, fn)
	}
	return r
}
439154
func (m *indexFileMap) FilesFor(sha string) []*indexFile {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	return m.nameMap[sha]
}
849431
func (s Service) MethodOptions() []string {
	optionSet := make(map[string]struct{})
	for _, method := range s.Methods {
		for option := range method.Options {
			optionSet[option] = struct{}{}
		}
	}
	if len(optionSet) == 0 {
		return nil
	}
	options := make([]string, 0, len(optionSet))
	for option := range optionSet {
		options = append(options, option)
	}
	sort.Strings(options)
	return options
}
1239094
func MethodFromForm(param string) MethodOverrideGetter {
	return func(c echo.Context) string {
		return c.Form(param)
	}
}
35351
func isPathForPod(path string) bool {
	parts := strings.SplitN(path, ":", 2)
	if len(parts) == 1 || (isWindows() && len(parts[0]) == 1) {
		return false
	}

	return true
}
943327
func (w *WebService) Method(httpMethod string) *RouteBuilder {
	return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method(httpMethod)
}
77805
func (r *Route) MiddlewareFor(m Middleware, verbs ...string) *Route {

	// Equivalent to none
	if len(verbs) == 0 {
		return r
	}

	f := verbFlag(0)
	for _, verb := range verbs {
		f = f | getVerbFlagForMethod(verb)
	}

	// we don't check if this is equivalent to flagAny since a
	// fully loaded flag set is the same as the flagAny

	r.middleware = append(r.middleware, &middlewareForVerb{
		mid:  m,
		verb: f,
	})

	return r

}
1075399
func (dm *DocumentMapping) analyzerNameForPath(path string) string {
	field := dm.fieldDescribedByPath(path)
	if field != nil {
		return field.Analyzer
	}
	return ""
}
230806
func (o *Operation) Methods() []string {
	methods := []string{
		o.ExportedName,
		o.ExportedName + "Request",
		o.ExportedName + "WithContext",
	}

	if o.Paginator != nil {
		methods = append(methods, []string{
			o.ExportedName + "Pages",
			o.ExportedName + "PagesWithContext",
		}...)
	}

	return methods
}
1127361
func methodName() string {
	pc, _, _, _ := runtime.Caller(2)
	f := runtime.FuncForPC(pc)
	if f == nil {
		return "unknown method"
	}
	return f.Name()
}
1054794
func (a *Wrapper) RouteMethods() {
	if _, valid := a.Controller.(Initer); !valid {
		a.Module.Core.Logger().Infof(`%T is no method Init(echo.Context)error, skiped.`, a.Controller)
		return
	}
	t := reflect.TypeOf(a.Controller)
	e := t.Elem()
	ctlPath := e.PkgPath() + `.(*` + e.Name() + `).`
	//github.com/webx-top/{Project}/app/{Module}/controller.(*Index).
	var ctl string
	if a.Module.URLConvert != nil {
		ctl = a.Module.URLConvert(e.Name())
	} else {
		ctl = e.Name()
	}
	a.ControllerName = ctl
	for i := t.NumMethod() - 1; i >= 0; i-- {
		m := t.Method(i)
		name := m.Name
		h := func(k string, u *URLBuilder) func(ctx echo.Context) error {
			return func(ctx echo.Context) error {
				return a.execute(ctx, k, e, u, name)
			}
		}
		if strings.HasSuffix(name, `_ANY`) {
			name = strings.TrimSuffix(name, `_ANY`)
			var pp string
			if a.Module.URLConvert != nil {
				pp = a.Module.URLConvert(name)
			} else {
				pp = name
			}
			ppath := `/` + ctl + `/` + pp
			k := ctlPath + name + `-fm`
			u := a.Module.Application.URLBuilder
			handler := NewHandler(h(k, u), k)
			a.addRouter(ctl, ppath, handler)
			continue
		}
		matches := methodSuffixRegex.FindAllString(name, 1)
		if len(matches) < 1 {
			continue
		}
		methods := strings.Split(strings.TrimPrefix(matches[0], `_`), `_`)
		name = strings.TrimSuffix(name, matches[0])
		var pp string
		if a.Module.URLConvert != nil {
			pp = a.Module.URLConvert(name)
		} else {
			pp = name
		}
		ppath := `/` + ctl + `/` + pp
		k := ctlPath + name + `-fm`
		u := a.Module.Application.URLBuilder
		handler := NewHandler(h(k, u), k)
		a.addRouter(ctl, ppath, handler, methods...)
	}
}
533643
func (r *Router) Methods(methods []string, path string, fn http.HandlerFunc) *Router {
	r.Route(path).Methods(methods, fn)
	return r
}
873559
func (s Service) MethodsWithOption(optionName string) []*ServiceMethod {
	methods := make([]*ServiceMethod, 0, len(s.Methods))
	for _, method := range s.Methods {
		if _, ok := method.Options[optionName]; ok {
			methods = append(methods, method)
		}
	}
	if len(methods) > 0 {
		return methods
	}
	return nil
}
67541
func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) (gvrs []schema.GroupVersionResource, err error) {
	del, err := d.getDelegate()
	if err != nil {
		return nil, err
	}
	gvrs, err = del.ResourcesFor(input)
	if len(gvrs) == 0 && !d.cl.Fresh() {
		d.Reset()
		gvrs, err = d.ResourcesFor(input)
	}
	return
}
1353149
func (r *Route) Methods(methods ...string) *Route {
	for k, v := range methods {
		methods[k] = strings.ToUpper(v)
	}
	return r.addMatcher(methodMatcher(methods))
}