Documentation ¶
Index ¶
- type FlowCounter
- type FlowLimiter
- type LoadBalancer
- type MapBaseHandler
- type RedisFlowCountService
- func (fcs *RedisFlowCountService) GetDayData(t time.Time) (int64, error)
- func (fcs *RedisFlowCountService) GetDayKey(t time.Time) string
- func (fcs *RedisFlowCountService) GetHourData(t time.Time) (int64, error)
- func (fcs *RedisFlowCountService) GetHourKey(t time.Time) string
- func (fcs *RedisFlowCountService) Increase()
- type ReverseProxy
- func (p *ReverseProxy) GetGRPCReverseProxy(serviceDetail *model.ServiceDetail, lb load_balance.LoadBalance) (grpc.StreamHandler, error)
- func (p *ReverseProxy) GetHTTPReverseProxy(serviceDetail *model.ServiceDetail, lb load_balance.LoadBalance, ...) (*httputil.ReverseProxy, error)
- func (p *ReverseProxy) GetTCPReverseProxy(serviceDetail *model.ServiceDetail, c *router.TcpRouterContext, ...) (*reverseproxy.TcpReverseProxy, error)
- type ServiceManager
- type Transporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlowCounter ¶
type FlowCounter struct {
// contains filtered or unexported fields
}
var FlowCounterHandler *FlowCounter
func NewFlowCounter ¶
func NewFlowCounter() *FlowCounter
func (*FlowCounter) GetCounter ¶
func (fc *FlowCounter) GetCounter(serviceName string) (*RedisFlowCountService, error)
type FlowLimiter ¶
type FlowLimiter struct {
// contains filtered or unexported fields
}
var FlowLimiterHandler *FlowLimiter
func NewFlowLimiter ¶
func NewFlowLimiter() *FlowLimiter
func (*FlowLimiter) GetLimiter ¶
type LoadBalancer ¶
type LoadBalancer struct {
// contains filtered or unexported fields
}
var LoadBalancerHandler *LoadBalancer
func NewLoadBalancer ¶
func NewLoadBalancer() *LoadBalancer
func (*LoadBalancer) GetLoadBalancer ¶
func (lbr *LoadBalancer) GetLoadBalancer(serviceDetail *model.ServiceDetail) (load_balance.LoadBalance, error)
type MapBaseHandler ¶
func NewMapBaseHandler ¶
func NewMapBaseHandler[T any]() MapBaseHandler[T]
type RedisFlowCountService ¶
type RedisFlowCountService struct { ServiceName string Interval time.Duration QPS int64 Unix int64 TickerCount int64 TotalCount int64 }
RedisFlowCountService 流量统计
func NewRedisFlowCountService ¶
func NewRedisFlowCountService(serviceName string, interval time.Duration) *RedisFlowCountService
func (*RedisFlowCountService) GetDayData ¶
func (fcs *RedisFlowCountService) GetDayData(t time.Time) (int64, error)
func (*RedisFlowCountService) GetDayKey ¶
func (fcs *RedisFlowCountService) GetDayKey(t time.Time) string
func (*RedisFlowCountService) GetHourData ¶
func (fcs *RedisFlowCountService) GetHourData(t time.Time) (int64, error)
func (*RedisFlowCountService) GetHourKey ¶
func (fcs *RedisFlowCountService) GetHourKey(t time.Time) string
func (*RedisFlowCountService) Increase ¶
func (fcs *RedisFlowCountService) Increase()
type ReverseProxy ¶
type ReverseProxy struct {
// contains filtered or unexported fields
}
var ReverseProxyHandler *ReverseProxy
func NewReverseProxy ¶
func NewReverseProxy() *ReverseProxy
func (*ReverseProxy) GetGRPCReverseProxy ¶
func (p *ReverseProxy) GetGRPCReverseProxy(serviceDetail *model.ServiceDetail, lb load_balance.LoadBalance) (grpc.StreamHandler, error)
func (*ReverseProxy) GetHTTPReverseProxy ¶
func (p *ReverseProxy) GetHTTPReverseProxy(serviceDetail *model.ServiceDetail, lb load_balance.LoadBalance, transport *http.Transport) (*httputil.ReverseProxy, error)
func (*ReverseProxy) GetTCPReverseProxy ¶
func (p *ReverseProxy) GetTCPReverseProxy(serviceDetail *model.ServiceDetail, c *router.TcpRouterContext, lb load_balance.LoadBalance) (*reverseproxy.TcpReverseProxy, error)
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
var ServiceManagerHandler *ServiceManager
func NewServiceManager ¶
func NewServiceManager() *ServiceManager
func (*ServiceManager) GetGrpcServiceList ¶
func (sm *ServiceManager) GetGrpcServiceList() []*model.ServiceDetail
func (*ServiceManager) GetTcpServiceList ¶
func (sm *ServiceManager) GetTcpServiceList() []*model.ServiceDetail
func (*ServiceManager) HTTPAccessMode ¶
func (sm *ServiceManager) HTTPAccessMode(host, path string) (*model.ServiceDetail, error)
HTTPAccessMode 请求的URL/HOST是否匹配Service规则
func (*ServiceManager) LoadOnce ¶
func (sm *ServiceManager) LoadOnce() error
type Transporter ¶
type Transporter struct {
// contains filtered or unexported fields
}
var TransporterHandler *Transporter
func NewTransporter ¶
func NewTransporter() *Transporter
func (*Transporter) GetTransporter ¶
func (t *Transporter) GetTransporter(serviceDetail *model.ServiceDetail) (*http.Transport, error)
Click to show internal directories.
Click to hide internal directories.