# Functions
CollectEscapeStringOption is used to collect string using escaping from input map for given option.
CollectStringOption is used to collect string using from input map for given option.
DeferClose captures the error returned from closing (if an error occurs).
DoDelete is used to send delete request and return http response code.
ErrorResp Respond to the client about the given error, integrating with errcode.ErrorCode.
GetCallerIDOnHTTP returns caller ID from the request header.
GetIPPortFromHTTPRequest returns http client host IP and port from context.
GetJSON is used to send GET request to specific url.
GetRouteName return mux route name registered.
NewAccessPath returns an AccessPath.
NewCallerIDRoundTripper returns a new `CallerIDRoundTripper`.
NewCustomReverseProxies returns the custom reverse proxies.
ParseHexKeys decodes hexadecimal src into DecodedLen(len(src)) bytes if the format is "hex".
ParseKey is used to parse interface into []byte and string.
ParseTime parses a time string with the format "1694580288" If the string is empty, it returns a zero time.
ParseUint64VarsField connects strconv.ParseUint with request variables It hardcodes the base to 10 and bit size to 64 Any error returned will connect the requested field to the error via FieldError.
PatchJSON is used to do patch request.
PostJSON is used to send the POST request to a specific URL.
PostJSONIgnoreResp is used to do post request with JSON body and ignore response.
ReadJSON reads a JSON data from r and then closes it.
ReadJSONRespondError writes json into data.
RegisterUserDefinedHandlers register the user defined handlers.
TagJSONError wraps the JSON error to one type.
# Constants
CorePath the core group, is at REST path `/pd/api/v1`.
ExtensionsPath the named groups are REST at `/pd/apis/{GROUP_NAME}/{Version}`.
#nosec G101.
PDRedirectorHeader is used to mark which PD redirected this request.
XCallerIDHeader is used to mark the caller ID.
XForbiddenForwardToMicroServiceHeader is used to indicate that forwarding the request to a microservice is explicitly disallowed.
XForwardedForHeader is used to mark the client IP.
XForwardedPortHeader is used to mark the client port.
XForwardedToMicroServiceHeader is used to signal that the request has already been forwarded to a microservice.
XRealIPHeader is used to mark the real client IP.
# Structs
AccessPath is used to identify HTTP api access path including path and method.
APIServiceGroup used to register the HTTP REST API.
CallerIDRoundTripper is used to add caller ID in the HTTP header.
FieldError connects an error to a particular field.
JSONError lets callers check for just one error type.