Documentation
¶
Index ¶
- type AuthConfig
- type BreakerConfig
- type Client
- func (c *Client) Close() error
- func (c *Client) DictData() tp.DictDataClient
- func (c *Client) DictType() tp.DictTypeClient
- func (c *Client) GetConn() *grpc.ClientConn
- func (c *Client) GetStats() map[string]interface{}
- func (c *Client) IsHealthy() bool
- func (c *Client) Platform() tp.PlatformClient
- func (c *Client) PlatformAuth() tp.PlatformAuthClient
- func (c *Client) RpcService() tp.RpcServiceClient
- func (c *Client) RpcServiceGroup() tp.RpcServiceGroupClient
- func (c *Client) RpcServiceMethod() tp.RpcServiceMethodClient
- func (c *Client) RpcServiceMethodLog() tp.RpcServiceMethodLogClient
- func (c *Client) WaitForReady(timeout time.Duration) error
- type ClientConfig
- type ClientStats
- type EtcdConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶ added in v0.0.4
AuthConfig 认证配置
type BreakerConfig ¶ added in v0.0.4
BreakerConfig 熔断器配置
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 平台服务 SDK 客户端
func (*Client) PlatformAuth ¶
func (c *Client) PlatformAuth() tp.PlatformAuthClient
PlatformAuth 返回平台权限客户端
func (*Client) RpcServiceGroup ¶
func (c *Client) RpcServiceGroup() tp.RpcServiceGroupClient
RpcServiceGroup 返回微服务分组客户端
func (*Client) RpcServiceMethod ¶
func (c *Client) RpcServiceMethod() tp.RpcServiceMethodClient
RpcServiceMethod 返回微服务方法客户端
func (*Client) RpcServiceMethodLog ¶
func (c *Client) RpcServiceMethodLog() tp.RpcServiceMethodLogClient
RpcServiceMethodLog 返回微服务调用日志客户端
type ClientConfig ¶
type ClientConfig struct {
// 直连模式:服务器地址,格式: localhost:8080 或 127.0.0.1:8080
Address string
// etcd 服务发现配置
Etcd *EtcdConfig
// 认证配置
Auth *AuthConfig
// 连接超时时间,默认 5 秒
Timeout time.Duration
// 是否使用 TLS,默认不使用
UseTLS bool
// TLS 证书路径(仅在 UseTLS=true 时有效)
CertFile string
// 最大接收消息大小,默认 4MB
MaxRecvMsgSize int
// 最大发送消息大小,默认 4MB
MaxSendMsgSize int
// 最大重试次数,默认 3
MaxRetryAttempts int
// 熔断器配置
Breaker *BreakerConfig
}
ClientConfig SDK 客户端配置
type ClientStats ¶ added in v0.0.4
type ClientStats struct {
TotalCalls int64 `json:"total_calls"`
SuccessCalls int64 `json:"success_calls"`
FailedCalls int64 `json:"failed_calls"`
AvgLatency float64 `json:"avg_latency_ms"`
TotalLatency int64 `json:"total_latency_ms"` // 用于计算平均值
LastCallTime time.Time `json:"last_call_time"`
LastErrorMsg string `json:"last_error_msg,omitempty"`
ConnectionState string `json:"connection_state"`
// contains filtered or unexported fields
}
ClientStats SDK 客户端统计信息
type EtcdConfig ¶ added in v0.0.4
EtcdConfig etcd 服务发现配置
Directories
¶
| Path | Synopsis |
|---|---|
|
services
|
|
|
dict/client
Code generated by SDK generator.
|
Code generated by SDK generator. |
|
platform/client
Code generated by SDK generator.
|
Code generated by SDK generator. |
|
platform_auth/client
Code generated by SDK generator.
|
Code generated by SDK generator. |
|
rpc_service/client
Code generated by SDK generator.
|
Code generated by SDK generator. |
Click to show internal directories.
Click to hide internal directories.