Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClusterDispatcher ¶
func NewClusterDispatcher(client ClusterClient, conn *grpc.ClientConn, config ClusterDispatcherConfig, secondaryDispatch map[string]SecondaryDispatch, secondaryDispatchExprs map[string]*DispatchExpr) dispatch.Dispatcher
NewClusterDispatcher creates a dispatcher implementation that uses the provided client to dispatch requests to peer nodes in the cluster.
func RunDispatchExpr ¶ added in v1.27.0
func RunDispatchExpr[R any](de *DispatchExpr, request R) ([]string, error)
RunDispatchExpr runs a dispatch CEL expression over the given request and returns the secondary dispatchers to invoke, if any.
Types ¶
type ClusterClient ¶ added in v1.27.0
type ClusterClient interface { DispatchCheck(ctx context.Context, req *v1.DispatchCheckRequest, opts ...grpc.CallOption) (*v1.DispatchCheckResponse, error) DispatchExpand(ctx context.Context, req *v1.DispatchExpandRequest, opts ...grpc.CallOption) (*v1.DispatchExpandResponse, error) DispatchReachableResources(ctx context.Context, in *v1.DispatchReachableResourcesRequest, opts ...grpc.CallOption) (v1.DispatchService_DispatchReachableResourcesClient, error) DispatchLookupResources(ctx context.Context, in *v1.DispatchLookupResourcesRequest, opts ...grpc.CallOption) (v1.DispatchService_DispatchLookupResourcesClient, error) DispatchLookupSubjects(ctx context.Context, in *v1.DispatchLookupSubjectsRequest, opts ...grpc.CallOption) (v1.DispatchService_DispatchLookupSubjectsClient, error) }
type ClusterDispatcherConfig ¶ added in v1.16.2
type DispatchExpr ¶ added in v1.27.0
type DispatchExpr struct {
// contains filtered or unexported fields
}
DispatchExpr is a CEL expression that can be run to determine the secondary dispatchers, if any, to invoke for the incoming request.
func ParseDispatchExpression ¶ added in v1.27.0
func ParseDispatchExpression(methodName string, exprString string) (*DispatchExpr, error)
ParseDispatchExpression parses a dispatch expression via CEL.
type SecondaryDispatch ¶ added in v1.27.0
type SecondaryDispatch struct { Name string Client ClusterClient }
SecondaryDispatch defines a struct holding a client and its name for secondary dispatching.
Click to show internal directories.
Click to hide internal directories.