Home | History | Annotate | Download | only in http

Lines Matching refs:ctr

39 func (ctr *Counter) String() string {
40 ctr.mu.Lock()
41 defer ctr.mu.Unlock()
42 return fmt.Sprintf("%d", ctr.n)
45 func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
46 ctr.mu.Lock()
47 defer ctr.mu.Unlock()
50 ctr.n++
58 ctr.n = n
62 fmt.Fprintf(w, "counter = %d\n", ctr.n)
127 ctr := new(Counter)
128 expvar.Publish("counter", ctr)
129 http.Handle("/counter", ctr)