proto

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

gRPC building instructions

The first thing you need is Protocol Buffer Compiler Installation.
Then install go plugins for the protocol compiler:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Now you can rebuild this with the following command:

protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sum.proto

Documentation

Index

Constants

View Source
const (
	Sum_Sum_FullMethodName = "/Sum/Sum"
)

Variables

View Source
var Sum_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Sum",
	HandlerType: (*SumServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Sum",
			Handler:    _Sum_Sum_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sum.proto",
}

Sum_ServiceDesc is the grpc.ServiceDesc for Sum service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSumServer

func RegisterSumServer(s grpc.ServiceRegistrar, srv SumServer)

Types

type SumClient

type SumClient interface {
	Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error)
}

SumClient is the client API for Sum service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewSumClient

func NewSumClient(cc grpc.ClientConnInterface) SumClient

type SumRequest

type SumRequest struct {
	A int64 `protobuf:"varint,1,opt,name=a,proto3" json:"a,omitempty"`
	B int64 `protobuf:"varint,2,opt,name=b,proto3" json:"b,omitempty"`
	// contains filtered or unexported fields
}

func (*SumRequest) Descriptor deprecated

func (*SumRequest) Descriptor() ([]byte, []int)

Deprecated: Use SumRequest.ProtoReflect.Descriptor instead.

func (*SumRequest) GetA

func (x *SumRequest) GetA() int64

func (*SumRequest) GetB

func (x *SumRequest) GetB() int64

func (*SumRequest) ProtoMessage

func (*SumRequest) ProtoMessage()

func (*SumRequest) ProtoReflect

func (x *SumRequest) ProtoReflect() protoreflect.Message

func (*SumRequest) Reset

func (x *SumRequest) Reset()

func (*SumRequest) String

func (x *SumRequest) String() string

type SumResponse

type SumResponse struct {
	Sum int64 `protobuf:"varint,1,opt,name=sum,proto3" json:"sum,omitempty"`
	// contains filtered or unexported fields
}

func (*SumResponse) Descriptor deprecated

func (*SumResponse) Descriptor() ([]byte, []int)

Deprecated: Use SumResponse.ProtoReflect.Descriptor instead.

func (*SumResponse) GetSum

func (x *SumResponse) GetSum() int64

func (*SumResponse) ProtoMessage

func (*SumResponse) ProtoMessage()

func (*SumResponse) ProtoReflect

func (x *SumResponse) ProtoReflect() protoreflect.Message

func (*SumResponse) Reset

func (x *SumResponse) Reset()

func (*SumResponse) String

func (x *SumResponse) String() string

type SumServer

type SumServer interface {
	Sum(context.Context, *SumRequest) (*SumResponse, error)
	// contains filtered or unexported methods
}

SumServer is the server API for Sum service. All implementations must embed UnimplementedSumServer for forward compatibility

type UnimplementedSumServer

type UnimplementedSumServer struct {
}

UnimplementedSumServer must be embedded to have forward compatible implementations.

func (UnimplementedSumServer) Sum

type UnsafeSumServer

type UnsafeSumServer interface {
	// contains filtered or unexported methods
}

UnsafeSumServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SumServer will result in compilation errors.

Jump to

Keyboard shortcuts

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