Documentation
¶
Overview ¶
Package grpctest provides the test implementation for the grpctest Service.
Index ¶
- func NewServer(opts ...ServiceOption) *grpc.Server
- func StartServer(t *testing.T, opts ...ServiceOption) func(context.Context, string) (net.Conn, error)
- type Service
- func (s *Service) CreateItems(itemsServer grpctest.ItemService_CreateItemsServer) error
- func (s *Service) GetItem(ctx context.Context, request *grpctest.GetItemRequest) (*grpctest.Item, error)
- func (s *Service) ListItems(request *grpctest.ListItemsRequest, ...) error
- func (s *Service) TransformItems(itemsServer grpctest.ItemService_TransformItemsServer) error
- type ServiceOption
- func CreateItems(h func(itemsServer grpctest.ItemService_CreateItemsServer) error) ServiceOption
- func GetItem(h func(context.Context, *grpctest.GetItemRequest) (*grpctest.Item, error)) ServiceOption
- func ListItems(h func(*grpctest.ListItemsRequest, grpctest.ItemService_ListItemsServer) error) ServiceOption
- func TransformItems(h func(itemsServer grpctest.ItemService_TransformItemsServer) error) ServiceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(opts ...ServiceOption) *grpc.Server
NewServer initiates a new grpctest Service.
Types ¶
type Service ¶
type Service struct { grpctest.UnimplementedItemServiceServer // contains filtered or unexported fields }
Service is an implementation of grpctest.ItemServiceServer.
func (*Service) CreateItems ¶
func (s *Service) CreateItems(itemsServer grpctest.ItemService_CreateItemsServer) error
CreateItems satisfies grpctest.ItemServiceServer.
func (*Service) GetItem ¶
func (s *Service) GetItem(ctx context.Context, request *grpctest.GetItemRequest) (*grpctest.Item, error)
GetItem satisfies grpctest.ItemServiceServer.
func (*Service) ListItems ¶
func (s *Service) ListItems(request *grpctest.ListItemsRequest, itemsServer grpctest.ItemService_ListItemsServer) error
ListItems satisfies grpctest.ItemServiceServer.
func (*Service) TransformItems ¶
func (s *Service) TransformItems(itemsServer grpctest.ItemService_TransformItemsServer) error
TransformItems satisfies grpctest.ItemServiceServer.
type ServiceOption ¶
type ServiceOption func(s *Service)
ServiceOption sets up the service.
func CreateItems ¶
func CreateItems(h func(itemsServer grpctest.ItemService_CreateItemsServer) error) ServiceOption
CreateItems sets a handler for creating items.
func GetItem ¶
func GetItem(h func(context.Context, *grpctest.GetItemRequest) (*grpctest.Item, error)) ServiceOption
GetItem sets a handler for getting item.
func ListItems ¶
func ListItems(h func(*grpctest.ListItemsRequest, grpctest.ItemService_ListItemsServer) error) ServiceOption
ListItems sets a handler for listing item.
func TransformItems ¶
func TransformItems(h func(itemsServer grpctest.ItemService_TransformItemsServer) error) ServiceOption
TransformItems sets a handler for transforming items.
Click to show internal directories.
Click to hide internal directories.