MCPcopy Create free account
hub / github.com/eth-easl/dirigent / init

Method init

workload/http_workload.go:144–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142}
143
144func (mux *Multiplexer) init() {
145 handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
146 // you can allow only http2 request
147 //if r.ProtoMajor != 2 {
148 // log.Println("HTTP/2 request is rejected")
149 // w.WriteHeader(http.StatusInternalServerError)
150 // return
151 //}
152
153 f := mux.GetHandler(r.URL.Path)
154 if f == nil {
155 log.Println("unknown path", r.URL.Path)
156 return
157 }
158 f(w, r)
159 })
160 mux.Handler = handler
161}
162
163func (mux *Multiplexer) GetHandler(path string) func(w http.ResponseWriter, r *http.Request) {
164 f, ok := mux.handlers[path]

Callers 1

NewMultiplexerFunction · 0.95

Calls 1

GetHandlerMethod · 0.95

Tested by

no test coverage detected