MCPcopy
hub / github.com/gofiber/fiber / methodInt

Method methodInt

helpers.go:902–932  ·  view source on GitHub ↗

HTTP methods and their unique INTs

(s string)

Source from the content-addressed store, hash-verified

900
901// HTTP methods and their unique INTs
902func (app *App) methodInt(s string) int {
903 // For better performance
904 if len(app.configured.RequestMethods) == 0 {
905 switch s {
906 case MethodGet:
907 return methodGet
908 case MethodHead:
909 return methodHead
910 case MethodPost:
911 return methodPost
912 case MethodPut:
913 return methodPut
914 case MethodDelete:
915 return methodDelete
916 case MethodConnect:
917 return methodConnect
918 case MethodOptions:
919 return methodOptions
920 case MethodTrace:
921 return methodTrace
922 case MethodPatch:
923 return methodPatch
924 case MethodQuery:
925 return methodQuery
926 default:
927 return -1
928 }
929 }
930 // For method customization
931 return slices.Index(app.config.RequestMethods, s)
932}
933
934func (app *App) method(methodInt int) string {
935 return app.config.RequestMethods[methodInt]

Callers 12

deleteRouteMethod · 0.95
registerMethod · 0.95
addRouteMethod · 0.95
MethodMethod · 0.80
Test_App_ChainingFunction · 0.80
Test_App_StackFunction · 0.80
ResetMethod · 0.80

Calls

no outgoing calls

Tested by 5

Test_App_ChainingFunction · 0.64
Test_App_StackFunction · 0.64