Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EndpointCache ¶
type EndpointCache struct {
// contains filtered or unexported fields
}
缓存端点实例
func NewEndpointCache ¶
func NewEndpointCache(factory Factory, logger *log.Logger, options EndpointerOptions) *EndpointCache
func (*EndpointCache) Endpoints ¶
func (c *EndpointCache) Endpoints() ([]Endpoint, error)
func (*EndpointCache) Update ¶
func (c *EndpointCache) Update(event events.Event)
type EndpointCloser ¶
type EndpointerOption ¶
type EndpointerOption func(*EndpointerOptions)
func InvalidateOnError ¶
func InvalidateOnError(timeout time.Duration) EndpointerOption
type EndpointerOptions ¶
type ErrorWrapper ¶
ErrorWrapper 包装端点错误
func (*ErrorWrapper) Error ¶
func (e *ErrorWrapper) Error() string
func (*ErrorWrapper) Unwrap ¶
func (e *ErrorWrapper) Unwrap() error
type Metrics ¶
type Metrics struct {
RequestCount int64
ErrorCount int64
SuccessCount int64
TotalDuration time.Duration
LastRequestTime time.Time
}
Metrics 端点指标
type Middleware ¶
定义端点中间件类型
func ErrorHandlingMiddleware ¶
func ErrorHandlingMiddleware(operation string) Middleware
ErrorHandlingMiddleware 错误处理中间件
func MetricsMiddleware ¶
func MetricsMiddleware(metrics *Metrics) Middleware
MetricsMiddleware 指标收集中间件
Source Files
¶
Click to show internal directories.
Click to hide internal directories.