service

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTwoZeroes is an arbitrary business rule for the Add method.
	ErrTwoZeroes = errors.New("can't sum two zeroes")

	// ErrIntOverflow protects the Add method. We've decided that this error
	// indicates a misbehaving service and should count against e.g. circuit
	// breakers. So, we return it directly in endpoints, to illustrate the
	// difference. In a real service, this probably wouldn't be the case.
	ErrIntOverflow = errors.New("integer overflow")

	// ErrMaxSizeExceeded protects the Concat method.
	ErrMaxSizeExceeded = errors.New("result exceeds maximum size")
)

Functions

This section is empty.

Types

type AddSvc

type AddSvc struct {
	pb.UnimplementedAddServer
}

func (AddSvc) Concat

func (s AddSvc) Concat(ctx context.Context, req *pb.ConcatRequest) (*pb.ConcatReply, error)

func (AddSvc) Sum

func (s AddSvc) Sum(ctx context.Context, req *pb.SumRequest) (*pb.SumReply, error)

type HelloSvc

type HelloSvc struct {
	pb.UnimplementedHelloWorldServiceServer
}

func (HelloSvc) SayHello

func (h HelloSvc) SayHello(ctx context.Context, req *pb.HelloRequest) (*pb.HelloResponse, error)

Jump to

Keyboard shortcuts

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