server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGrpcMethodRequest

func DecodeGrpcMethodRequest(ctx context.Context, v interface{}, md metadata.MD) (interface{}, error)

DecodeGrpcMethodRequest decodes requests sent to "test" service "grpc_method" endpoint.

func EncodeGrpcMethodResponse

func EncodeGrpcMethodResponse(ctx context.Context, v interface{}, hdr, trlr *metadata.MD) (interface{}, error)

EncodeGrpcMethodResponse encodes responses from the "test" service "grpc_method" endpoint.

func EncodeGrpcStreamResponse

func EncodeGrpcStreamResponse(ctx context.Context, v interface{}, hdr, trlr *metadata.MD) (interface{}, error)

EncodeGrpcStreamResponse encodes responses from the "test" service "grpc_stream" endpoint.

func NewGrpcMethodHandler

func NewGrpcMethodHandler(endpoint goa.Endpoint, h goagrpc.UnaryHandler) goagrpc.UnaryHandler

NewGrpcMethodHandler creates a gRPC handler which serves the "test" service "grpc_method" endpoint.

func NewGrpcMethodPayload

func NewGrpcMethodPayload(message *testpb.GrpcMethodRequest) *test.Fields

NewGrpcMethodPayload builds the payload of the "grpc_method" endpoint of the "test" service from the gRPC request type.

func NewGrpcStreamHandler

func NewGrpcStreamHandler(endpoint goa.Endpoint, h goagrpc.StreamHandler) goagrpc.StreamHandler

NewGrpcStreamHandler creates a gRPC handler which serves the "test" service "grpc_stream" endpoint.

func NewProtoGrpcMethodResponse added in v0.10.0

func NewProtoGrpcMethodResponse(result *test.Fields) *testpb.GrpcMethodResponse

NewProtoGrpcMethodResponse builds the gRPC response type from the result of the "grpc_method" endpoint of the "test" service.

func NewProtoGrpcStreamResponse added in v0.10.0

func NewProtoGrpcStreamResponse(result *test.Fields) *testpb.GrpcStreamResponse

NewProtoGrpcStreamResponse builds the gRPC response type from the result of the "grpc_stream" endpoint of the "test" service.

Types

type GrpcStreamServerStream

type GrpcStreamServerStream struct {
	// contains filtered or unexported fields
}

GrpcStreamServerStream implements the test.GrpcStreamServerStream interface.

func (*GrpcStreamServerStream) Close

func (s *GrpcStreamServerStream) Close() error

func (*GrpcStreamServerStream) Recv

func (s *GrpcStreamServerStream) Recv() (*test.Fields, error)

Recv reads instances of "testpb.GrpcStreamStreamingRequest" from the "grpc_stream" endpoint gRPC stream.

func (*GrpcStreamServerStream) Send

func (s *GrpcStreamServerStream) Send(res *test.Fields) error

Send streams instances of "testpb.GrpcStreamResponse" to the "grpc_stream" endpoint gRPC stream.

type Server

type Server struct {
	GrpcMethodH goagrpc.UnaryHandler
	GrpcStreamH goagrpc.StreamHandler
	testpb.UnimplementedTestServer
}

Server implements the testpb.TestServer interface.

func New

New instantiates the server struct with the test service endpoints.

func (*Server) GrpcMethod

func (s *Server) GrpcMethod(ctx context.Context, message *testpb.GrpcMethodRequest) (*testpb.GrpcMethodResponse, error)

GrpcMethod implements the "GrpcMethod" method in testpb.TestServer interface.

func (*Server) GrpcStream

func (s *Server) GrpcStream(stream testpb.Test_GrpcStreamServer) error

GrpcStream implements the "GrpcStream" method in testpb.TestServer interface.

Jump to

Keyboard shortcuts

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