Documentation ¶
Overview ¶
Created by guoxin in 2023/12/8 14:00
Created by guoxin in 2023/12/8 15:46
Created by guoxin in 2023/12/8 18:00
Index ¶
- type Addresses
- type HttpClientRequest
- type HttpConn
- func (h *HttpConn) GetAddresses() []string
- func (h *HttpConn) NewAddress(addresses []resolver.Address)
- func (h *HttpConn) NewServiceConfig(serviceConfig string)
- func (h *HttpConn) ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult
- func (h *HttpConn) ReportError(err error)
- func (h *HttpConn) SetAddresses(addresses []string)
- func (h *HttpConn) UpdateState(state resolver.State) error
- type HttpMethod
- type HttpPath
- type NacosHttpClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpClientRequest ¶
type HttpClientRequest interface { // HttpMethod 指定请求方法 HttpMethod // HttpPath 指定请求路径 HttpPath }
HttpClientRequest 使用client组件访问接口的请求需要实现这个接口
type HttpConn ¶
func (*HttpConn) ParseServiceConfig ¶
func (h *HttpConn) ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult
type HttpMethod ¶
type HttpMethod interface {
GetMethod() string
}
HttpMethod 指定请求方法 可选参数如下 see: http.MethodGet see: http.MethodHead see: http.MethodPost see: http.MethodPut see: http.MethodPatch see: http.MethodDelete see: http.MethodConnect see: http.MethodOptions see: http.MethodTrace
type NacosHttpClient ¶
type NacosHttpClient struct {
// contains filtered or unexported fields
}
NacosHttpClient 基于Nacos的Http调用客户端
func NewNacosHttpClient ¶
func NewNacosHttpClient(nacos *nacos.Nacos, clientConn HttpConn) (*NacosHttpClient, error)
NewNacosHttpClient 创建 基于Nacos的Http调用客户端
func (*NacosHttpClient) Call ¶
func (c *NacosHttpClient) Call(ctx context.Context, req HttpClientRequest, res any) error
Call 基于Nacos的Http调用客户端
Click to show internal directories.
Click to hide internal directories.