MCPcopy Create free account
hub / github.com/fvbock/endless / main

Function main

examples/hook.go:25–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25func main() {
26 mux1 := mux.NewRouter()
27 mux1.HandleFunc("/hello", handler).
28 Methods("GET")
29
30 srv := endless.NewServer("localhost:4244", mux1)
31 srv.SignalHooks[endless.PRE_SIGNAL][syscall.SIGUSR1] = append(
32 srv.SignalHooks[endless.PRE_SIGNAL][syscall.SIGUSR1],
33 preSigUsr1)
34 srv.SignalHooks[endless.POST_SIGNAL][syscall.SIGUSR1] = append(
35 srv.SignalHooks[endless.POST_SIGNAL][syscall.SIGUSR1],
36 postSigUsr1)
37
38 err := srv.ListenAndServe()
39 if err != nil {
40 log.Println(err)
41 }
42 log.Println("Server on 4244 stopped")
43
44 os.Exit(0)
45}

Callers

nothing calls this directly

Calls 1

ListenAndServeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…