braintree / manners

A polite Go HTTP server that shuts down gracefully.
MIT License
997 stars 103 forks source link

Can you please allow GracefulListener to be constructed outside of manners package? #8

Closed lestrrat closed 10 years ago

lestrrat commented 10 years ago

I was using the old manners, which allowed custom built listeners to be passed to the HTTP serving func.

The new API /almost/ allows you to do that, except I can't create a GracefulListener struct from outside of manners because it has private fields.

This would be solved if you either make those public, or if you can add NewListener func:

// this...
type GracefulListener struct {
    net.Listener
    Open bool
    Server *GracefulServer
}

// or this...
func NewLisneter(listener net.Listener, s *GracefulServer) {
    return &GracefulListener { listener, true, s }
}
lionelbarrow commented 10 years ago

Whoops, this is an oversight on my part.

lionelbarrow commented 10 years ago

Fixed in https://github.com/braintree/manners/commit/6bedecd1735b762bbab0936f9c8b73db28b75c1d.