Documentation ¶
Overview ¶
Package sandarbha is thin wrapper for context.
Comes from word sandarbha, means context in Nepali. It will make pass request-scoped values, cancelation signals, and deadlines across API boundaries to all the goroutines involved in handling a request, easier
Index ¶
- func GenerateRequestID(name string) string
- func HTTPDo(ctx context.Context, req *http.Request, f func(*http.Response, error) error) error
- func New(timeout int, ctx1 context.Context) (ctx context.Context, cancel context.CancelFunc)
- func RequestID(ctx context.Context) string
- func SetCtxRequestID(ctx context.Context, reqID string) context.Context
- func ULID() string
- func UUID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPDo ¶
HTTPDo issues the HTTP request and calls f with the response. If ctx.Done is closed while the request or f is running, HTTPDo cancels the request, waits for f to exit, and returns ctx.Err. Otherwise, HTTPDo returns f's error.
func SetCtxRequestID ¶
SetCtxRequestID ...
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.