Versions in this module Expand all Collapse all v1 v1.0.0 May 11, 2024 Changes in this version + const HeaderAccept + const HeaderAcceptEncoding + const HeaderAcceptLanguage + const HeaderAccessControlAllowCredentials + const HeaderAccessControlAllowHeaders + const HeaderAccessControlAllowMethods + const HeaderAccessControlAllowOrigin + const HeaderAccessControlExposeHeaders + const HeaderAccessControlMaxAge + const HeaderAccessControlRequestHeaders + const HeaderAccessControlRequestMethod + const HeaderAccessToken + const HeaderAllow + const HeaderAuthorization + const HeaderCaErrorCode + const HeaderCaErrorMessage + const HeaderCacheControl + const HeaderContentDisposition + const HeaderContentEncoding + const HeaderContentLength + const HeaderContentType + const HeaderDate + const HeaderHost + const HeaderLocation + const HeaderOrigin + const HeaderRange + const HeaderReferer + const HeaderToken + const HeaderUserAgent + const HeaderVary + const HeaderXAppEngineRemoteAddr + const HeaderXCSRFToken + const HeaderXForwardedFor + const HeaderXHealthSecret + const HeaderXRealIP + const HeaderXRequestedWith + const MIMEApplicationJSON + const MIMEApplicationPDF + const MIMEApplicationXML + const MIMEApplicationZip + const MIMEForm + const MIMEMultipartForm + const MIMEMultipartFormWithBoundary + const MIMEOctetStream + const MIMETextPlain + const MethodConnect + const MethodDelete + const MethodGet + const MethodHead + const MethodOptions + const MethodPatch + const MethodPost + const MethodPut + const MethodTrace + const SchemeHTTPPrefix + const SchemeHTTPSPrefix + func CopyRequest(r *http.Request, maxBodyLen ...int64) (*http.Request, error) + func ErrorCtx(ctx context.Context, w http.ResponseWriter, err error) + func FromFile(r *http.Request, name string) (*multipart.FileHeader, error) + func GetClientIP(r *http.Request) string + func GetInternalIP() string + func GetQuery(r *http.Request, key string) (string, bool) + func GetQueryArray(r *http.Request, key string) ([]string, bool) + func GetReaderLen(reader io.Reader) (int64, error) + func GetTraceID(ctx context.Context) string + func NewHTTPClient(config ...Config) *http.Client + func OkJsonCtx(ctx context.Context, w http.ResponseWriter, v any) + func Parse(r *http.Request, v any) error + func ParseEndpoint(endpoint string) (parsedEndpoint string, useSSL bool) + func ParseForm(r *http.Request, v any) error + func ParseJsonBody(r *http.Request, v any) error + func Query(r *http.Request, key string) string + func QueryArray(r *http.Request, key string) []string + func TypeByExtension(filePath string) string + func WithHTTPScheme(url string) string + func WriteHeader(w http.ResponseWriter, err ...error) + type Config struct + DialKeepAlive time.Duration + DialTimeout time.Duration + ExpectContinueTimeout time.Duration + HTTPTimeout time.Duration + IdleConnTimeout time.Duration + MaxIdleConns int + MaxIdleConnsPerHost int + TLSHandshakeTimeout time.Duration + func DefaultConfig() Config + type DetailLoggedResponseWriter struct + Buf *bytes.Buffer + W *LoggedResponseWriter + func NewDetailLoggedResponseWriter(w http.ResponseWriter) *DetailLoggedResponseWriter + func (w *DetailLoggedResponseWriter) Flush() + func (w *DetailLoggedResponseWriter) Header() http.Header + func (w *DetailLoggedResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (w *DetailLoggedResponseWriter) Write(bs []byte) (int, error) + func (w *DetailLoggedResponseWriter) WriteHeader(code int) + type LoggedResponseWriter struct + Code int + W http.ResponseWriter + func NewLoggedResponseWriter(w http.ResponseWriter) *LoggedResponseWriter + func (w *LoggedResponseWriter) Flush() + func (w *LoggedResponseWriter) Header() http.Header + func (w *LoggedResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (w *LoggedResponseWriter) Write(bs []byte) (int, error) + func (w *LoggedResponseWriter) WriteHeader(code int) + type MultipartWriter struct + func NewMultipartWriter(w io.Writer) *MultipartWriter + func (w *MultipartWriter) Boundary() string + func (w *MultipartWriter) Close() error + func (w *MultipartWriter) CreateFormField(fieldName string) (io.Writer, error) + func (w *MultipartWriter) CreateFormFile(fieldName, fileName string, contentType ...string) (io.Writer, error) + func (w *MultipartWriter) CreatePart(header textproto.MIMEHeader) (io.Writer, error) + func (w *MultipartWriter) FormDataContentType() string + func (w *MultipartWriter) SetBoundary(boundary string) error + func (w *MultipartWriter) WriteField(fieldName, value string) error + func (w *MultipartWriter) WriteFile(fieldName, fileName string, fileReader io.Reader, contentType ...string) (string, error) + type Response struct + Code uint32 + Data any + Msg string + TraceID string