Documentation
¶
Index ¶
- Constants
- func NewCircuitBreaker(opts ...Option) client.Option
- func NewClientOption(opts ...Option) client.Option
- func NewClientSuite(opts ...Option) client.Suite
- func NewLimiter(opts ...Option) server.Option
- func NewRetryPolicy(opts ...Option) client.Option
- func NewServerOption(opts ...Option) server.Option
- func NewServerSuite(opts ...Option) server.Suite
- func NewXDSRouterMiddleware(opts ...Option) endpoint.Middleware
- func SetXDSResourceManager(m XDSResourceManager) error
- func XDSInited() bool
- type Option
- type Options
- type RouteResult
- type XDSResolver
- func (r *XDSResolver) Diff(cacheKey string, prev, next discovery.Result) (discovery.Change, bool)
- func (r *XDSResolver) Name() string
- func (r *XDSResolver) Resolve(ctx context.Context, desc string) (discovery.Result, error)
- func (r *XDSResolver) Target(ctx context.Context, target rpcinfo.EndpointInfo) (description string)
- type XDSResourceManager
- type XDSRouter
Constants ¶
const (
// RouterClusterKey picked cluster in rpcInfo tag key
RouterClusterKey = "XDS_Route_Picked_Cluster"
)
Variables ¶
This section is empty.
Functions ¶
func NewCircuitBreaker ¶ added in v0.4.0
NewCircuitBreaker integrate xds config and kitex circuitbreaker
func NewClientOption ¶ added in v0.4.1
NewClientOption wrapper for NewClientSuite
func NewClientSuite ¶ added in v0.4.0
NewClientSuite client suite for xds handler
func NewLimiter ¶ added in v0.4.0
NewLimiter creates a server limiter
func NewRetryPolicy ¶ added in v0.4.0
NewRetryPolicy integrate xds config and kitex circuitbreaker
func NewServerOption ¶ added in v0.4.1
NewServerOption wrapper for NewServerSuite.
func NewServerSuite ¶ added in v0.4.0
NewServerSuite server suite for xds handler
func NewXDSRouterMiddleware ¶
func NewXDSRouterMiddleware(opts ...Option) endpoint.Middleware
NewXDSRouterMiddleware creates a middleware for request routing via XDS. This middleware picks one upstream cluster and sets RPCTimeout based on route config retrieved from XDS.
func SetXDSResourceManager ¶
func SetXDSResourceManager(m XDSResourceManager) error
SetXDSResourceManager builds the XDSResourceManager using the input function.
Types ¶
type Option ¶
type Option struct {
F func(o *Options)
}
func WithMatchRetryMethod ¶ added in v0.4.1
WithMatchRetryMethod configures the flag of matchRetryMethod
func WithRouterMetaExtractor ¶
func WithRouterMetaExtractor(routerMetaExtractor routerMetaExtractor) Option
WithRouterMetaExtractor configures the extractor for metadata
func WithServiceCircuitBreak ¶ added in v0.4.1
WithServiceCircuitBreak if enable service dimension circuitbreak
func WithServicePort ¶ added in v0.4.1
WithServicePort configures the service port, used for rate limit.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options for xds suite
func NewOptions ¶
type RouteResult ¶
RouteResult stores the result of route
type XDSResolver ¶
type XDSResolver struct {
// contains filtered or unexported fields
}
XDSResolver uses xdsResourceManager to get endpoints.
func NewXDSResolver ¶
func NewXDSResolver() *XDSResolver
func (*XDSResolver) Name ¶
func (r *XDSResolver) Name() string
Name returns the name of the resolver.
func (*XDSResolver) Resolve ¶
Resolve returns a list of instances for the given description of a target.
func (*XDSResolver) Target ¶
func (r *XDSResolver) Target(ctx context.Context, target rpcinfo.EndpointInfo) (description string)
Target should return a description for the given target that is suitable for being a key for cache.
type XDSResourceManager ¶
type XDSResourceManager interface { Get(ctx context.Context, resourceType xdsresource.ResourceType, resourceName string) (interface{}, error) // RegisterXDSUpdateHandler registers the callback function for the specified resource RegisterXDSUpdateHandler(resourceType xdsresource.ResourceType, handler xdsresource.XDSUpdateHandler) }
XDSResourceManager is the interface for the xds resource manager. Get() returns the resources according to the input resourceType and resourceName. Get() returns error when the fetching fails or the resource is not found in the latest update.
type XDSRouter ¶
type XDSRouter struct {
// contains filtered or unexported fields
}
XDSRouter is a router that uses xds to route the rpc call