MCPcopy Create free account
hub / github.com/kataras/iris / HandlersNames

Function HandlersNames

context/handler.go:169–187  ·  view source on GitHub ↗

HandlersNames returns a slice of "handlers" names separated by commas. Can be used for debugging or to determinate if end-developer called the same exactly Use/UseRouter/Done... API methods so framework can give a warning.

(handlers ...interface{})

Source from the content-addressed store, hash-verified

167// called the same exactly Use/UseRouter/Done... API methods
168// so framework can give a warning.
169func HandlersNames(handlers ...interface{}) string {
170 if len(handlers) == 1 {
171 if hs, ok := handlers[0].(Handlers); ok {
172 asInterfaces := make([]interface{}, 0, len(hs))
173 for _, h := range hs {
174 asInterfaces = append(asInterfaces, h)
175 }
176
177 return HandlersNames(asInterfaces...)
178 }
179 }
180
181 names := make([]string, 0, len(handlers))
182 for _, h := range handlers {
183 names = append(names, HandlerName(h))
184 }
185
186 return strings.Join(names, ",")
187}
188
189// HandlerFileLine returns the handler's file and line information.
190// See `context.HandlerFileLine` to get the file, line of the current running handler in the chain.

Callers

nothing calls this directly

Calls 1

HandlerNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…