server

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAddRequest

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

DecodeAddRequest decodes requests sent to "calc" service "add" endpoint.

func EncodeAddResponse

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

EncodeAddResponse encodes responses from the "calc" service "add" endpoint.

func NewAddHandler

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

NewAddHandler creates a gRPC handler which serves the "calc" service "add" endpoint.

func NewAddPayload

func NewAddPayload(message *calcpb.AddRequest) *calc.AddPayload

NewAddPayload builds the payload of the "add" endpoint of the "calc" service from the gRPC request type.

func NewAddResponse

func NewAddResponse(result int) *calcpb.AddResponse

NewAddResponse builds the gRPC response type from the result of the "add" endpoint of the "calc" service.

Types

type ErrorNamer

type ErrorNamer interface {
	ErrorName() string
}

ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the expr.

type Server

type Server struct {
	AddH goagrpc.UnaryHandler
}

Server implements the calcpb.CalcServer interface.

func New

New instantiates the server struct with the calc service endpoints.

func (*Server) Add

func (s *Server) Add(ctx context.Context, message *calcpb.AddRequest) (*calcpb.AddResponse, error)

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

Jump to

Keyboard shortcuts

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