(options ...Option)
| 21 | type Option func(*Server) *Server |
| 22 | |
| 23 | func New(options ...Option) *Server { |
| 24 | s := &Server{ |
| 25 | bindAddr: "127.0.0.1", |
| 26 | } |
| 27 | |
| 28 | for _, option := range options { |
| 29 | s = option(s) |
| 30 | } |
| 31 | return s |
| 32 | } |
| 33 | |
| 34 | func WithBindPort(port int) Option { |
| 35 | return func(s *Server) *Server { |
no outgoing calls
no test coverage detected