endpoints_resolver.go raw

   1  package endpoints
   2  
   3  import (
   4  	"context"
   5  
   6  	"google.golang.org/grpc"
   7  	"google.golang.org/protobuf/reflect/protoreflect"
   8  )
   9  
  10  // EndpointsResolver defines an interface to resolve gRPC service endpoints dynamically based on method and options.
  11  // The Endpoint method retrieves an endpoint instance, ensuring identical pointers for similar method requests.
  12  // Endpoint instances are not cached by the caller and can be used for connection management and pooling.
  13  type EndpointsResolver interface {
  14  	Endpoint(ctx context.Context, method protoreflect.FullName, opts ...grpc.CallOption) (*Endpoint, error)
  15  }
  16