From 8b2bf3574390a97b2f017580427d78ad72f0c8c8 Mon Sep 17 00:00:00 2001 From: Naitik Shah Date: Mon, 25 Mar 2013 14:39:26 -0700 Subject: [PATCH] remove some duplication --- grace.go | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/grace.go b/grace.go index 5d63171..6a6d160 100644 --- a/grace.go +++ b/grace.go @@ -35,10 +35,18 @@ const ( dec = false ) +// A FileListener is a file backed net.Listener. +type FileListener interface { + net.Listener + + // Will return the underlying file representing this Listener. + File() (f *os.File, err error) +} + // A Listener providing a graceful Close process and can be sent // across processes using the underlying File descriptor. type Listener interface { - net.Listener + FileListener // Will indicate that a Close is requested preventing further Accept. It will // also wait for the active connections to be terminated before returning. @@ -46,17 +54,6 @@ type Listener interface { // public API for cases where the socket must not be closed (such as systemd // activation). CloseRequest() - - // Will return the underlying file representing this Listener. - File() (f *os.File, err error) -} - -// A FileListener is a file backed net.Listener. -type FileListener interface { - net.Listener - - // Will return the underlying file representing this Listener. - File() (f *os.File, err error) } // A goroutine based counter that provides graceful Close for listeners.