Documentation ¶
Overview ¶
Package bow 网关服务包
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bow ¶
type Bow struct {
AllWay map[string]*RouteService
}
Bow 路由入口对象
func (*Bow) AddService ¶
AddService 新增路由服务
func (*Bow) AddServices ¶
func (s *Bow) AddServices(routeServiceArr []*RouteService)
AddServices 新增路由服务数组
type Limit ¶
type Limit struct { LimitMillisecond int64 `yaml:"LimitMillisecond"` // 请求限定的时间段(毫秒) LimitCount int `yaml:"LimitCount"` // 请求限定的时间段内允许的请求次数 LimitIntervalMillisecond int64 `yaml:"LimitIntervalMillisecond"` // 请求允许的最小间隔时间(毫秒),0表示不限 LimitChan chan int // 限流通道 Times []int64 // 请求时间数组 }
Limit 限流对象
type RouteService ¶
type RouteService struct { Name string `yaml:"Name"` // 服务名称 InURI string `yaml:"InURI"` // 路由入口 URI OutRemote string `yaml:"OutRemote"` // 路由出口地址 Limit *Limit `yaml:"Limit"` // 服务限流策略 }
RouteService 路由对象
type RouteServices ¶
type RouteServices struct {
Routes []*RouteService `yaml:"routes"`
}
RouteServices 路由对象数组
Click to show internal directories.
Click to hide internal directories.