Documentation
¶
Index ¶
- Constants
- func ListenWaitHTTP(ctx context.Context, s *http.Server, opts ...ListenWaitHTTPOption) error
- type ListenWaitHTTPOption
- func ListenWaitWithHTTPCloserRequireContext(fn func(ctx context.Context) error) ListenWaitHTTPOption
- func ListenWaitWithHTTPCloserWhen(fn func(ctx context.Context) error) ListenWaitHTTPOption
- func ListenWaitWithHTTPShutdownTimeout(timeout time.Duration) ListenWaitHTTPOption
- func ListenWaitWithTLS(certificateFile, keyFile string) ListenWaitHTTPOption
- type ListenWaitHTTPOptions
Constants ¶
View Source
const ( // DefaultListenWaitHTTPShutdownTimeout is the time to allow connections to // cleanly close. 30 seconds is the GKE preemption time, so we cut it a // little shorter. DefaultListenWaitHTTPShutdownTimeout = 25 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ListenWaitHTTP ¶
ListenWaitHTTP will run a server and catch the context close but allow existing connections to clean up nicely instead of immediately exiting.
Types ¶
type ListenWaitHTTPOption ¶
type ListenWaitHTTPOption func(opts *ListenWaitHTTPOptions)
func ListenWaitWithHTTPCloserRequireContext ¶
func ListenWaitWithHTTPCloserRequireContext(fn func(ctx context.Context) error) ListenWaitHTTPOption
func ListenWaitWithHTTPCloserWhen ¶
func ListenWaitWithHTTPCloserWhen(fn func(ctx context.Context) error) ListenWaitHTTPOption
func ListenWaitWithHTTPShutdownTimeout ¶
func ListenWaitWithHTTPShutdownTimeout(timeout time.Duration) ListenWaitHTTPOption
func ListenWaitWithTLS ¶
func ListenWaitWithTLS(certificateFile, keyFile string) ListenWaitHTTPOption
Click to show internal directories.
Click to hide internal directories.