Documentation ¶
Index ¶
- func ServeGRPC(ctx context.Context, server *grpc.Server, port int) error
- func ServeHTTP(ctx context.Context, server *http.Server, options ServeOptions) error
- func WithCancelOnTerminate(ctx context.Context) context.Context
- func WithMinimumDuration(parentCtx context.Context, d time.Duration) (context.Context, context.CancelFunc)
- type ServeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeGRPC ¶
ServeGRPC serves a GRPC server and performs a graceful shutdown if/when ctx is cancelled.
func ServeHTTP ¶
ServeHTTP serves a HTTP server and performs a graceful shutdown if/when ctx is cancelled.
func WithCancelOnTerminate ¶
WithCancelOnTerminate derives a context that is cancelled on SIGINT and SIGTERM signals.
func WithMinimumDuration ¶ added in v0.53.0
func WithMinimumDuration(parentCtx context.Context, d time.Duration) (context.Context, context.CancelFunc)
WithMinimumDuration derives a context that delays the parent's cancellation until the provided minimum duration has elapsed. When done with the derived context, call the returned cancel function to clean up associated resources.
Types ¶
type ServeOptions ¶ added in v0.42.0
Click to show internal directories.
Click to hide internal directories.