exhttp

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonFormat bodyFormat = iota + 1
	RawStringFormat
)

Variables

This section is empty.

Functions

func GetDefaultHTTPClient

func GetDefaultHTTPClient() *http.Client

func NewHTTPClient

func NewHTTPClient() *http.Client

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

func SetDefaultHTTPClient(httpclient http.Client)

Config global http DefaultClient

func WrapLog

func WrapLog(baseClient *http.Client, loggingCf LoggingConfig) *http.Client

WrapLog ..

func WrapOtelPropagator

func WrapOtelPropagator(
	baseClient *http.Client,
) *http.Client

WrapOtelPropagator ..

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

type UploadTxt

type UploadTxt []byte

Interface for slogger Uploader

func (UploadTxt) Content

func (x UploadTxt) Content() []byte

func (UploadTxt) Ext

func (x UploadTxt) Ext() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL