(resp []byte)
| 60 | } |
| 61 | |
| 62 | func WithResponse(resp []byte) Option { |
| 63 | return func(s *Server) *Server { |
| 64 | s.handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 65 | _, _ = w.Write(resp) |
| 66 | }) |
| 67 | return s |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func (s *Server) Run() error { |
| 72 | if err := s.initListener(); err != nil { |