server

package
v0.0.0-...-5a969d9 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeDivideRequest

func DecodeDivideRequest(ctx context.Context, v any, md metadata.MD) (any, error)

DecodeDivideRequest decodes requests sent to "calc" service "divide" endpoint.

func EncodeDivideResponse

func EncodeDivideResponse(ctx context.Context, v any, hdr, trlr *metadata.MD) (any, error)

EncodeDivideResponse encodes responses from the "calc" service "divide" endpoint.

func NewDivideDivByZeroError

func NewDivideDivByZeroError(er *calc.DivByZero) *calcpb.DivideDivByZeroError

NewDivideDivByZeroError builds the gRPC error response type from the error of the "divide" endpoint of the "calc" service.

func NewDivideHandler

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

NewDivideHandler creates a gRPC handler which serves the "calc" service "divide" endpoint.

func NewDividePayload

func NewDividePayload(message *calcpb.DivideRequest) *calc.DividePayload

NewDividePayload builds the payload of the "divide" endpoint of the "calc" service from the gRPC request type.

func NewProtoDivideResponse

func NewProtoDivideResponse(result *calc.DivideResult) *calcpb.DivideResponse

NewProtoDivideResponse builds the gRPC response type from the result of the "divide" endpoint of the "calc" service.

Types

type Server

type Server struct {
	DivideH goagrpc.UnaryHandler
	calcpb.UnimplementedCalcServer
}

Server implements the calcpb.CalcServer interface.

func New

New instantiates the server struct with the calc service endpoints.

func (*Server) Divide

func (s *Server) Divide(ctx context.Context, message *calcpb.DivideRequest) (*calcpb.DivideResponse, error)

Divide implements the "Divide" method in calcpb.CalcServer interface.

Jump to

Keyboard shortcuts

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