Versions in this module Expand all Collapse all v1 v1.1.0 Apr 6, 2022 v1.0.0 Mar 23, 2022 Changes in this version + const DefaultHttpIdleTimeout + var ErrBalancerNil = errors.New("balancer nil") + var ErrServiceAlreadyExists = errors.New("service already exists") + var ErrServiceNotExists = errors.New("service not exists") + func InitErpc(ctx context.Context, rpcNetConfigs []RpcNetConfigInfo) error + func NewSingleHttpClientManager(conf []HttpManagerConfig) error + type HttpClient struct + func NewHttpClient(conf *HttpClientConfig, b balancer.Balancer) (*HttpClient, error) + func (h *HttpClient) AddAddr(addr string, wight int) error + func (h *HttpClient) Close() + func (h *HttpClient) RemoveAddr(addr string) error + func (h *HttpClient) Send(ctx context.Context, method HttpMethod, key []byte, uri string, ...) ([]byte, error) + type HttpClientConfig struct + BaseConfig RpcNetConfigInfo + type HttpClientManager struct + var HttpManager *HttpClientManager + func NewHttpClientManager() *HttpClientManager + func (hm *HttpClientManager) GetClient(serviceName string) (*HttpClient, error) + func (hm *HttpClientManager) NewHttpClient(conf *HttpClientConfig, b balancer.Balancer) error + type HttpManagerConfig struct + Balancer balancer.Balancer + Httpconf *HttpClientConfig + type HttpMethod string + const DELETE + const GET + const HEAD + const POST + const PUT + type RpcClient interface + Send func() + type RpcNetConfigInfo struct + Addr []string + Balancetype string + DialTimeout int + EndpointsFrom string + IdleConnTimeout int + MaxConnsPerAddr int + MaxIdleConns int + MaxIdleConnsPerAddr int + Proto string + ReadBufferSize int + RetryTimes int + ServiceName string + TimeOut int + Wight []int + WriteBufferSize int