feat(tracing): Implement Jaeger/OpenTracing provider with configuration options
- Added Punycode encoding implementation for cookie handling. - Introduced serialization for cookie jar with JSON support. - Created a comprehensive README for the tracing provider, detailing configuration and usage. - Developed a configuration structure for tracing, including sampler and reporter settings. - Implemented the provider logic to initialize Jaeger tracer with logging capabilities. - Ensured graceful shutdown of the tracer on application exit.
This commit is contained in:
37
templates/providers/req/config.go.tpl
Normal file
37
templates/providers/req/config.go.tpl
Normal file
@@ -0,0 +1,37 @@
|
||||
package req
|
||||
|
||||
import (
|
||||
"go.ipao.vip/atom/container"
|
||||
"go.ipao.vip/atom/opt"
|
||||
)
|
||||
|
||||
const DefaultPrefix = "HttpClient"
|
||||
|
||||
func DefaultProvider() container.ProviderContainer {
|
||||
return container.ProviderContainer{
|
||||
Provider: Provide,
|
||||
Options: []opt.Option{
|
||||
opt.Prefix(DefaultPrefix),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
DevMode bool
|
||||
CookieJarFile string
|
||||
RootCa []string
|
||||
UserAgent string
|
||||
InsecureSkipVerify bool
|
||||
CommonHeaders map[string]string
|
||||
CommonQuery map[string]string
|
||||
BaseURL string
|
||||
ContentType string
|
||||
Timeout uint
|
||||
AuthBasic struct {
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
AuthBearerToken string
|
||||
ProxyURL string
|
||||
RedirectPolicy []string // "Max:10;No;SameDomain;SameHost;AllowedHost:x,x,x,x,x,AllowedDomain:x,x,x,x,x"
|
||||
}
|
||||
Reference in New Issue
Block a user