Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextServer ¶
type ContextServer struct {
// contains filtered or unexported fields
}
ContextServer is a Server controlled by a context for stopping gracefully
func NewContextServer ¶
func NewContextServer(ctx context.Context, handler http.Handler) *ContextServer
NewContextServer constructs and returns a server. Mux has the same meaning as in the standard HTTP package (that is, if nil it will use the globally registered handlers)
func (*ContextServer) ListenAndServe ¶
func (s *ContextServer) ListenAndServe(addr string) error
ListenAndServe does the same thing as the net/http equivalent, except using the context.
func (*ContextServer) ListenAndServeTLS ¶
func (s *ContextServer) ListenAndServeTLS(addr, certFile, keyFile string) error
ListenAndServeTLS does the same thing as the net/http equivalent, except using the context.
Click to show internal directories.
Click to hide internal directories.