MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / main

Function main

examples/overlay/main.go:11–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func main() {
12 // create a type that satisfies the `api.ServerInterface`, which contains an implementation of every operation from the generated code
13 server := api.NewServer()
14
15 r := mux.NewRouter()
16
17 // get an `http.Handler` that we can use
18 h := api.HandlerFromMux(server, r)
19
20 s := &http.Server{
21 Handler: h,
22 Addr: "0.0.0.0:8080",
23 }
24
25 // And we serve HTTP until the world ends.
26 log.Fatal(s.ListenAndServe())
27}

Callers

nothing calls this directly

Calls 2

NewServerFunction · 0.92
HandlerFromMuxFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…