Documentation ¶
Index ¶
- type Config
- func (cfg Config) BuildHttpCfg(log *util.ClientLogger) *HttpCfg
- func (cfg Config) BuildLogCfg() *log2.Config
- func (cfg Config) BuildRetryCfg(log *util.ClientLogger) *RetryCfg
- func (cfg Config) BuildUserInfo(Uid, Token string) (u *UserInfo)
- func (cfg Config) GetIntValue(cfgName string, defaultVal int, log *util.ClientLogger) int
- func (cfg Config) GetStringValue(cfgName string, defaultVal string, log *util.ClientLogger) string
- type HttpCfg
- type RetryCfg
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
func (Config) BuildHttpCfg ¶
func (cfg Config) BuildHttpCfg(log *util.ClientLogger) *HttpCfg
func (Config) BuildLogCfg ¶
func (Config) BuildRetryCfg ¶
func (cfg Config) BuildRetryCfg(log *util.ClientLogger) *RetryCfg
func (Config) BuildUserInfo ¶
func (Config) GetIntValue ¶
func (Config) GetStringValue ¶
type HttpCfg ¶
type HttpCfg struct { Hosts []string `json:"hosts"` // The destination service address list, must not be empty TryTimes uint32 `json:"try_times"` // Maximum attempts for a request, TryTimes = RetryTimes + 1 ClientTimeoutMS int `json:"client_timeout_ms"` // Timeout duration of the http client,see http.Client MaxFailsPeriodS int64 `json:"max_fails_period_s"` // Penalty time for failures ShouldRetry func(code int, err error) bool `json:"-"` }
type UserInfo ¶
type UserInfo struct { // Unique user id. The third-party vendor must ensure that the ID is globally unique Uid string // User access token, used for authentication when accessing the server. // The third-party vendor determines the token generation rules and validity period. // The minimum validity period must be more than 10s. If it is too small, // the token may be expired before the request reaches the server Token string }
Click to show internal directories.
Click to hide internal directories.