Documentation
¶
Index ¶
- Constants
- func BasicAuth(username, password string) decorator.Decorator
- func DumpRequest(outDir ...string) decorator.Decorator
- func DumpResponse(outDir ...string) decorator.Decorator
- func LogOff()
- func LogOn()
- func LogSet(l *zap.Logger)
- func RetryOnBadProxy(maxTimes uint) decorator.Decorator
- func RetryOnTimeout(maxTimes uint, timeout time.Duration) decorator.Decorator
- func TokenAuth(token string) decorator.Decorator
- func UserAgent() decorator.Decorator
- func XdailiProxyAuth(order, secret string) decorator.Decorator
- func ZapVerboseLogger(l *zap.Logger) decorator.Decorator
Constants ¶
View Source
const (
UserAgentRandomSeed = "ourhttp-user-agent-seed"
)
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
BasicAuth is a middleware decorator for basic access authentication with username and password.
func DumpRequest ¶
func DumpResponse ¶
func RetryOnBadProxy ¶
RetryOnBadProxy is a middleware decorator to retry with backoff + random for gateway issues.
func RetryOnTimeout ¶
RetryOnTimeout is a middleware decorator to retry on request timeout.
func UserAgent ¶
UserAgent is a middleware decorator to add random User-Agent in the header. In order to get the consistent user agent for various requests, you may set random seed as a string value in the request context with `middleware.UserAgentRandomSeed` as the key.
func XdailiProxyAuth ¶
XdailiProxyAuth is a middleware decorator for authentication of xdaili.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.