Documentation
¶
Index ¶
- Constants
- func GetDefaultHTTPClient() *http.Client
- func NewHTTPClient() *http.Client
- func NewHTTPWithCfg(timeout *time.Duration, proxy *url.URL, certFile *string, keyFile *string, ...) *http.Client
- func NewLoggingRoundTripper(base http.RoundTripper, cf LoggingConfig) http.RoundTripper
- func SetDefaultHTTPClient(httpclient http.Client)
- func WrapLog(baseClient *http.Client, loggingCf LoggingConfig) *http.Client
- func WrapOtelPropagator(baseClient *http.Client) *http.Client
- type LoggingConfig
- type UploadJson
- type UploadTxt
Constants ¶
View Source
const ( JsonFormat bodyFormat = iota + 1 RawStringFormat )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultHTTPClient ¶
func NewHTTPClient ¶
NewHTTPClient ..if timeout == nil -> use default value.
func NewHTTPWithCfg ¶
func NewHTTPWithCfg( timeout *time.Duration, proxy *url.URL, certFile *string, keyFile *string, caFile *string, insecureSkipVerify bool, ) *http.Client
NewHTTPWithCfg ..if timeout == nil -> use default value (60s timeout).
func NewLoggingRoundTripper ¶
func NewLoggingRoundTripper(base http.RoundTripper, cf LoggingConfig) http.RoundTripper
func SetDefaultHTTPClient ¶
Config global http DefaultClient
Types ¶
type LoggingConfig ¶
type LoggingConfig struct {
ShowHeaders bool
ShowBody bool
FieldValueMaxLength int
// LogStoreUpload .. upload to store if body too long (can't log to stdout)
// Should be upload in background and return Upload Key Path instantly for increase performance.
// If there is any error when upload. Handle and notify in other way.
BodyFormatForLog bodyFormat
}
type UploadJson ¶
type UploadJson []byte
func (UploadJson) Content ¶
func (x UploadJson) Content() []byte
func (UploadJson) Ext ¶
func (x UploadJson) Ext() string
Click to show internal directories.
Click to hide internal directories.