Documentation ¶
Overview ¶
Package xcontext helps managing context.Context with timeout.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustHandleError ¶
MustHandleError checks if there is an error in the given Context.
If no error, returns the previous error.
If context.DeadlineExceeded, wraps the previous error inside an xerror.Error with xerror.TimeoutCode.
Otherwise wraps the previous error inside an xerror.Error.
It panics if no previous error.
func WithTimeout ¶
WithTimeout creates a context.Context which times out after given seconds.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.