Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitBreaker ¶ added in v3.1.16
type CircuitBreaker struct {
// contains filtered or unexported fields
}
CircuitBreaker 熔断器
type ConnectionPool ¶ added in v3.1.16
type ConnectionPool struct {
// contains filtered or unexported fields
}
ConnectionPool 连接池管理器
func NewConnectionPool ¶ added in v3.1.16
func NewConnectionPool() *ConnectionPool
NewConnectionPool 创建连接池管理器
func (*ConnectionPool) Get ¶ added in v3.1.16
func (cp *ConnectionPool) Get(serviceName string) *ServicePool
Get 获取服务连接池
func (*ConnectionPool) GetOrCreate ¶ added in v3.1.16
func (cp *ConnectionPool) GetOrCreate(app *core.Core, serviceName string) *ServicePool
GetOrCreate 获取或创建服务连接池
func (*ConnectionPool) Remove ¶ added in v3.1.16
func (cp *ConnectionPool) Remove(serviceName string)
Remove 移除服务连接池
type EtcdGateway ¶
type EtcdGateway struct {
// contains filtered or unexported fields
}
EtcdGateway etcd 网关
func NewEtcdGateway ¶
func NewEtcdGateway(app *core.Core, conf ...*Config) (*EtcdGateway, error)
func (*EtcdGateway) Close ¶
func (gw *EtcdGateway) Close() error
type MethodDescriptor ¶
type ReflectionProxy ¶
type ReflectionProxy struct {
// contains filtered or unexported fields
}
func NewReflectionProxy ¶
func NewReflectionProxy(app *core.Core, addr string) (*ReflectionProxy, error)
func (*ReflectionProxy) Close ¶
func (p *ReflectionProxy) Close() error
func (*ReflectionProxy) Methods ¶
func (p *ReflectionProxy) Methods() map[string]*MethodDescriptor
Methods 返回所有已注册的方法
type Route ¶
type Route struct {
ID string `json:"id"`
Method string `json:"method"`
Path string `json:"path"`
ServiceName string `json:"service_name"`
GRPCMethod string `json:"grpc_method"`
Description string `json:"description"`
Headers map[string]string `json:"headers,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type ServicePool ¶ added in v3.1.16
type ServicePool struct {
// contains filtered or unexported fields
}
ServicePool 服务连接池(按 instanceID 管理多个实例连接)
func NewServicePool ¶ added in v3.1.16
func NewServicePool(app *core.Core, name string) *ServicePool
NewServicePool 创建服务连接池
func (*ServicePool) AddOrUpdateInstance ¶ added in v3.1.16
func (p *ServicePool) AddOrUpdateInstance(instanceID, addr string) (*ReflectionProxy, bool, error)
AddOrUpdateInstance 添加或更新一个实例连接 返回 changed=true 表示是新增或重建了 proxy
func (*ServicePool) Get ¶ added in v3.1.16
func (p *ServicePool) Get() *ReflectionProxy
Get 获取一个可用的 proxy(round-robin + 健康检查)
func (*ServicePool) RemoveInstance ¶ added in v3.1.16
func (p *ServicePool) RemoveInstance(instanceID string)
RemoveInstance 移除一个实例连接
Click to show internal directories.
Click to hide internal directories.