Documentation ¶
Overview ¶
Package service 提供了一些列资源管理的方法
Index ¶
- func CleanService()
- func LoadService(cfg []map[string]interface{}) error
- func RemoveService(name string)
- type Config
- func (rc *Config) Clone() *Config
- func (rc *Config) Format()
- func (rc *Config) GetAddr() string
- func (rc *Config) GetConf() *Config
- func (rc *Config) GetConnTimeout() time.Duration
- func (rc *Config) GetName() string
- func (rc *Config) GetProtocol() string
- func (rc *Config) GetReadTimeout() time.Duration
- func (rc *Config) GetRetry() int
- func (rc *Config) GetReuse() bool
- func (rc *Config) GetTotalTimeout() time.Duration
- func (rc *Config) GetWriteTimeout() time.Duration
- func (rc *Config) HeaderInfo(extra ...interface{}) (map[string]string, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Name string Addr string Retry int NSProvider string Protocol string Converter string Reuse bool // 连接复用 ConnTimeOut time.Duration WriteTimeOut time.Duration ReadTimeOut time.Duration Headers map[string]string }
Config cal 配置
func (*Config) GetConnTimeout ¶
GetConnTimeout 连接超时
func (*Config) GetTotalTimeout ¶
GetTotalTimeout 总超时
func (*Config) GetWriteTimeout ¶
GetWriteTimeout 写超时
type Service ¶
type Service interface { GetConf() *Config Clone() *Config GetName() string GetAddr() string GetTotalTimeout() time.Duration GetConnTimeout() time.Duration GetReadTimeout() time.Duration GetWriteTimeout() time.Duration GetProtocol() string GetRetry() int GetReuse() bool HeaderInfo(extra ...interface{}) (map[string]string, error) }
func NewService ¶
Click to show internal directories.
Click to hide internal directories.