grpctest

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package grpctest provides the test implementation for the grpctest Service.

Index

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.

func StartServer

func StartServer(t *testing.T, opts ...ServiceOption) func(context.Context, string) (net.Conn, error)

StartServer starts 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

GetItem sets a handler for getting item.

func ListItems

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL