github.com/goravel/framework@v1.13.9/contracts/grpc/grpc.go (about)

     1  package grpc
     2  
     3  import (
     4  	"context"
     5  
     6  	"google.golang.org/grpc"
     7  )
     8  
     9  //go:generate mockery --name=Grpc
    10  type Grpc interface {
    11  	// Run starts the gRPC server.
    12  	Run(host ...string) error
    13  	// Server gets the gRPC server instance.
    14  	Server() *grpc.Server
    15  	// Client gets the gRPC client instance.
    16  	Client(ctx context.Context, name string) (*grpc.ClientConn, error)
    17  	// UnaryServerInterceptors sets the gRPC server interceptors.
    18  	UnaryServerInterceptors([]grpc.UnaryServerInterceptor)
    19  	// UnaryClientInterceptorGroups sets the gRPC client interceptor groups.
    20  	UnaryClientInterceptorGroups(map[string][]grpc.UnaryClientInterceptor)
    21  }