Documentation ¶
Index ¶
- Constants
- func InjectWebCenter(s *WebCenter)
- func InjectWebClient(s *WebClient)
- func LoadWebCenter() baseiface.ISingleton
- func LoadWebClient() baseiface.ISingleton
- type WebCenter
- type WebClient
- func (this *WebClient) BindBody(ctx *gin.Context) ([]byte, error)
- func (this *WebClient) CheckServiceExists(ServerName string, checkTimes int) (address string)
- func (this *WebClient) Delete(url string) *basedto.IchubResult
- func (this *WebClient) DeleteWeb(msg *webmsg.WebMsg) (*resty.Response, error)
- func (this *WebClient) ExistServiceName() bool
- func (this *WebClient) Get(url string) *basedto.IchubResult
- func (this *WebClient) Get2PageResult(msg *webmsg.WebMsg) *page.PageResult
- func (this *WebClient) Get2Result(msg *webmsg.WebMsg) *basedto.IchubResult
- func (this *WebClient) GetServiceAddr() (address string)
- func (this *WebClient) GetServiceAddrBy(ServerName string) (address string)
- func (this *WebClient) GetServiceAddrs() []*registry.Service
- func (this *WebClient) GetServiceAll(serverName string) []*registry.Service
- func (this *WebClient) GetWeb(msg *webmsg.WebMsg) (*resty.Response, error)
- func (this *WebClient) IfServiceExists() bool
- func (this *WebClient) IfTestUrl() bool
- func (this *WebClient) Init() *WebClient
- func (this *WebClient) Post(body, url string) *basedto.IchubResult
- func (this *WebClient) Post2PageResult(msg *webmsg.WebMsg) *page.PageResult
- func (this *WebClient) Post2Result(msg *webmsg.WebMsg) *basedto.IchubResult
- func (this *WebClient) PostBatch(body, url string) *basedto.IchubResults
- func (this *WebClient) PostProxy(msg *webmsg.WebMsg, proxy baseiface.IbaseProxy) *basedto.IchubResult
- func (this *WebClient) PostWeb(msg *webmsg.WebMsg) (*resty.Response, error)
- func (this *WebClient) Put(body []byte, url string) *basedto.IchubResult
- func (this *WebClient) PutWeb(msg *webmsg.WebMsg) (*resty.Response, error)
- func (this *WebClient) ReadCfg()
- func (this *WebClient) RefreshAddr()
- func (this *WebClient) Resp2IchubResult(resp *resty.Response, err error) *basedto.IchubResult
- func (this *WebClient) Resp2IchubResults(resp *resty.Response, err error) *basedto.IchubResults
- func (this *WebClient) Resp2PageResult(resp *resty.Response, err error) *page.PageResult
- func (this *WebClient) SetBaseUrl(baseUrl string) string
- func (this *WebClient) ValueOf(clientDto *baseconfig.WebClientDto)
- func (this *WebClient) Web(msg *webmsg.WebMsg) (*resty.Response, error)
Constants ¶
View Source
const WebClient_Timeout = 20 * time.Second
@Title 文件名称: ichub_web_client.go @Description 描述: WEB客户端服务发现,支持多个服务
@Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)
Variables ¶
This section is empty.
Functions ¶
func InjectWebCenter ¶
func InjectWebCenter(s *WebCenter)
func InjectWebClient ¶
func InjectWebClient(s *WebClient)
func LoadWebCenter ¶
func LoadWebCenter() baseiface.ISingleton
func LoadWebClient ¶
func LoadWebClient() baseiface.ISingleton
Types ¶
type WebCenter ¶
type WebCenter struct { basedto.BaseEntitySingle // contains filtered or unexported fields }
不使用注册中心
func FindBeanWebCenter ¶
func FindBeanWebCenter() *WebCenter
func NewWebCenter ¶
func NewWebCenter() *WebCenter
func (*WebCenter) FindService ¶
func (self *WebCenter) FindService(serviceName string) *basedto.IchubResult
func (*WebCenter) Register ¶
func (self *WebCenter) Register(info *webdto.CenterInfo) *basedto.IchubResult
func (*WebCenter) Unregister ¶
func (self *WebCenter) Unregister(info *webdto.CenterInfo) *basedto.IchubResult
type WebClient ¶
type WebClient struct { basedto.BaseEntity // 可测试性 baseurl -> http://xxx.xxx.xxx.xxx:xx TestUrl string `json:"testUrl"` BaseUrl string `json:"baseUrl"` //服务名称 ServerName string `json:"serverName"` // etcd注册服务器地址 xxx.xxx.xxx.xxx:xx EtcdHosts []string `json:"etcdHosts"` Registry registry.Registry `json:"-"` Config *ichubconfig.IchubConfig `json:"-"` WebTimeout time.Duration `json:"webTimeout"` }
func FindBeanWebClient ¶
func FindBeanWebClient() *WebClient
func New ¶
func New(clientDto *baseconfig.WebClientDto) *WebClient
func NewByServiceName ¶
func NewWebClient ¶
func (*WebClient) CheckServiceExists ¶
func (*WebClient) ExistServiceName ¶
func (*WebClient) Get2PageResult ¶
func (this *WebClient) Get2PageResult(msg *webmsg.WebMsg) *page.PageResult
func (*WebClient) Get2Result ¶
func (this *WebClient) Get2Result(msg *webmsg.WebMsg) *basedto.IchubResult
func (*WebClient) GetServiceAddr ¶
func (*WebClient) GetServiceAddrBy ¶
func (*WebClient) GetServiceAddrs ¶
func (*WebClient) GetServiceAll ¶
func (*WebClient) IfServiceExists ¶
func (*WebClient) Post2PageResult ¶
func (this *WebClient) Post2PageResult(msg *webmsg.WebMsg) *page.PageResult
func (*WebClient) Post2Result ¶
func (this *WebClient) Post2Result(msg *webmsg.WebMsg) *basedto.IchubResult
func (*WebClient) PostBatch ¶
func (this *WebClient) PostBatch(body, url string) *basedto.IchubResults
func (*WebClient) PostProxy ¶
func (this *WebClient) PostProxy(msg *webmsg.WebMsg, proxy baseiface.IbaseProxy) *basedto.IchubResult
func (*WebClient) RefreshAddr ¶
func (this *WebClient) RefreshAddr()
func (*WebClient) Resp2IchubResult ¶
func (this *WebClient) Resp2IchubResult(resp *resty.Response, err error) *basedto.IchubResult
func (*WebClient) Resp2IchubResults ¶
func (this *WebClient) Resp2IchubResults(resp *resty.Response, err error) *basedto.IchubResults
func (*WebClient) Resp2PageResult ¶
func (this *WebClient) Resp2PageResult(resp *resty.Response, err error) *page.PageResult
func (*WebClient) SetBaseUrl ¶
func (*WebClient) ValueOf ¶
func (this *WebClient) ValueOf(clientDto *baseconfig.WebClientDto)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.