server: add GracefulTimeout option #304
| @@ -321,22 +321,19 @@ func Listener(l net.Listener) Option { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| <<<<<<< HEAD |  | ||||||
| // HandlerOption func | // HandlerOption func | ||||||
| type HandlerOption func(*HandlerOptions) | type HandlerOption func(*HandlerOptions) | ||||||
|  |  | ||||||
| // HandlerOptions struct | // GracefulTimeout duration | ||||||
| type HandlerOptions struct { | func GracefulTimeout(td time.Duration) options.Option { | ||||||
| ======= | 	return func(o *Options) { | ||||||
| func GracefulTimeout(t time.Duration) options.Option { | 		o.GracefulTimeout = td | ||||||
| 	return func(src interface{}) error { |  | ||||||
| 		return options.Set(src, t, ".GracefulTimeout") |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| // HandleOptions struct |  | ||||||
| type HandleOptions struct { | // HandlerOptions struct | ||||||
| >>>>>>> bf0c3016cb09 (add gracefultimeout in server) | type HandlerOptions struct { | ||||||
| 	// Context holds external options | 	// Context holds external options | ||||||
| 	Context context.Context | 	Context context.Context | ||||||
| 	// Metadata for handler | 	// Metadata for handler | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user