diff --git a/args.go b/args.go index cfec077..ef1eb18 100644 --- a/args.go +++ b/args.go @@ -21,16 +21,16 @@ func (cfg *args) defaultize() { cfg.ctx = context.TODO() } -type arg func(*args) +type Arg func(*args) -func FnShutdownTimeout(v func() time.Duration) arg { +func FnShutdownTimeout(v func() time.Duration) Arg { return func(cfg *args) { cfg.fnShutdownTimeout = v } } -func FnLog(v log.FnT) arg { +func FnLog(v log.FnT) Arg { return func(cfg *args) { cfg.fnLog = v } } -func Context(v context.Context) arg { +func Context(v context.Context) Arg { return func(cfg *args) { cfg.ctx = v } } diff --git a/listen-serve.go b/listen-serve.go index ffadbec..a0506c4 100644 --- a/listen-serve.go +++ b/listen-serve.go @@ -20,7 +20,7 @@ type ServerListener struct { func (sl *ServerListener) Addr() string { return sl.Server.Addr() } -func (it iterator) Listen(fnArgs ...arg) (ss Servers, errs []error) { +func (it iterator) Listen(fnArgs ...Arg) (ss Servers, errs []error) { cfg := args{} cfg.defaultize() @@ -102,7 +102,7 @@ func (it iterator) Listen(fnArgs ...arg) (ss Servers, errs []error) { return ss, errs } -func (it iterator) ServeHTTP(handler http.Handler, fnArgs ...arg) (chan struct{}, chan error) { +func (it iterator) ServeHTTP(handler http.Handler, fnArgs ...Arg) (chan struct{}, chan error) { it = it.FilterListener() cfg := args{} diff --git a/servers.go b/servers.go index 7d428cf..6f7c02e 100644 --- a/servers.go +++ b/servers.go @@ -207,11 +207,11 @@ func (ss *Servers) SetPortToFirstINET(port int) { setPort(port) } -func (ss *Servers) Listen(fnArgs ...arg) (Servers, []error) { +func (ss *Servers) Listen(fnArgs ...Arg) (Servers, []error) { return ss.IntoIter().Listen(fnArgs...) } -func (ss *Servers) ServeHTTP(handler http.Handler, fnArgs ...arg) (chan struct{}, chan error) { +func (ss *Servers) ServeHTTP(handler http.Handler, fnArgs ...Arg) (chan struct{}, chan error) { return ss.IntoIter().ServeHTTP(handler, fnArgs...) }