proto

package
v0.0.0-...-bb73ec8 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CalculatorActions_name = map[int32]string{
		0: "UNDEFINED_ACTION",
		1: "ADD",
		2: "MULTIPLY",
		3: "CLEAR",
	}
	CalculatorActions_value = map[string]int32{
		"UNDEFINED_ACTION": 0,
		"ADD":              1,
		"MULTIPLY":         2,
		"CLEAR":            3,
	}
)

Enum value maps for CalculatorActions.

View Source
var CalculatorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dummy.calculator.CalculatorService",
	HandlerType: (*CalculatorServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "operate",
			Handler:    _CalculatorService_Operate_Handler,
		},
		{
			MethodName: "sqrt",
			Handler:    _CalculatorService_Sqrt_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "primeFactorize",
			Handler:       _CalculatorService_PrimeFactorize_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "average",
			Handler:       _CalculatorService_Average_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "maxAmongAll",
			Handler:       _CalculatorService_MaxAmongAll_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "calculator/proto/calculator.proto",
}

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

View Source
var File_calculator_proto_average_proto protoreflect.FileDescriptor
View Source
var File_calculator_proto_calculator_proto protoreflect.FileDescriptor
View Source
var File_calculator_proto_max_among_all_proto protoreflect.FileDescriptor
View Source
var File_calculator_proto_operate_proto protoreflect.FileDescriptor
View Source
var File_calculator_proto_prime_factorization_proto protoreflect.FileDescriptor
View Source
var File_calculator_proto_square_root_proto protoreflect.FileDescriptor

Functions

func RegisterCalculatorServiceServer

func RegisterCalculatorServiceServer(s grpc.ServiceRegistrar, srv CalculatorServiceServer)

Types

type AverageRequest

type AverageRequest struct {
	Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*AverageRequest) Descriptor deprecated

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

Deprecated: Use AverageRequest.ProtoReflect.Descriptor instead.

func (*AverageRequest) GetNumber

func (x *AverageRequest) GetNumber() int32

func (*AverageRequest) ProtoMessage

func (*AverageRequest) ProtoMessage()

func (*AverageRequest) ProtoReflect

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

func (*AverageRequest) Reset

func (x *AverageRequest) Reset()

func (*AverageRequest) String

func (x *AverageRequest) String() string

type AverageResponse

type AverageResponse struct {
	Result float64 `protobuf:"fixed64,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*AverageResponse) Descriptor deprecated

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

Deprecated: Use AverageResponse.ProtoReflect.Descriptor instead.

func (*AverageResponse) GetResult

func (x *AverageResponse) GetResult() float64

func (*AverageResponse) ProtoMessage

func (*AverageResponse) ProtoMessage()

func (*AverageResponse) ProtoReflect

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

func (*AverageResponse) Reset

func (x *AverageResponse) Reset()

func (*AverageResponse) String

func (x *AverageResponse) String() string

type CalculatorActions

type CalculatorActions int32
const (
	CalculatorActions_UNDEFINED_ACTION CalculatorActions = 0
	CalculatorActions_ADD              CalculatorActions = 1
	CalculatorActions_MULTIPLY         CalculatorActions = 2
	CalculatorActions_CLEAR            CalculatorActions = 3
)

func (CalculatorActions) Descriptor

func (CalculatorActions) Enum

func (CalculatorActions) EnumDescriptor deprecated

func (CalculatorActions) EnumDescriptor() ([]byte, []int)

Deprecated: Use CalculatorActions.Descriptor instead.

func (CalculatorActions) Number

func (CalculatorActions) String

func (x CalculatorActions) String() string

func (CalculatorActions) Type

type CalculatorRequest

type CalculatorRequest struct {
	Action CalculatorActions `protobuf:"varint,1,opt,name=action,proto3,enum=dummy.calculator.CalculatorActions" json:"action,omitempty"`
	Value  int64             `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*CalculatorRequest) Descriptor deprecated

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

Deprecated: Use CalculatorRequest.ProtoReflect.Descriptor instead.

func (*CalculatorRequest) GetAction

func (x *CalculatorRequest) GetAction() CalculatorActions

func (*CalculatorRequest) GetValue

func (x *CalculatorRequest) GetValue() int64

func (*CalculatorRequest) ProtoMessage

func (*CalculatorRequest) ProtoMessage()

func (*CalculatorRequest) ProtoReflect

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

func (*CalculatorRequest) Reset

func (x *CalculatorRequest) Reset()

func (*CalculatorRequest) String

func (x *CalculatorRequest) String() string

type CalculatorResponse

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

func (*CalculatorResponse) Descriptor deprecated

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

Deprecated: Use CalculatorResponse.ProtoReflect.Descriptor instead.

func (*CalculatorResponse) GetResultantValue

func (x *CalculatorResponse) GetResultantValue() int64

func (*CalculatorResponse) ProtoMessage

func (*CalculatorResponse) ProtoMessage()

func (*CalculatorResponse) ProtoReflect

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

func (*CalculatorResponse) Reset

func (x *CalculatorResponse) Reset()

func (*CalculatorResponse) String

func (x *CalculatorResponse) String() string

type CalculatorServiceClient

CalculatorServiceClient is the client API for CalculatorService service.

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

type CalculatorServiceServer

type CalculatorServiceServer interface {
	Operate(context.Context, *CalculatorRequest) (*CalculatorResponse, error)
	PrimeFactorize(*PrimeFactorizationRequeset, CalculatorService_PrimeFactorizeServer) error
	Average(CalculatorService_AverageServer) error
	MaxAmongAll(CalculatorService_MaxAmongAllServer) error
	Sqrt(context.Context, *SquareRootRequest) (*SquareRootResponse, error)
	// contains filtered or unexported methods
}

CalculatorServiceServer is the server API for CalculatorService service. All implementations must embed UnimplementedCalculatorServiceServer for forward compatibility

type CalculatorService_AverageClient

type CalculatorService_AverageClient interface {
	Send(*AverageRequest) error
	CloseAndRecv() (*AverageResponse, error)
	grpc.ClientStream
}

type CalculatorService_AverageServer

type CalculatorService_AverageServer interface {
	SendAndClose(*AverageResponse) error
	Recv() (*AverageRequest, error)
	grpc.ServerStream
}

type CalculatorService_MaxAmongAllClient

type CalculatorService_MaxAmongAllClient interface {
	Send(*MaxAmongAllRequest) error
	Recv() (*MaxAmongAllResponse, error)
	grpc.ClientStream
}

type CalculatorService_MaxAmongAllServer

type CalculatorService_MaxAmongAllServer interface {
	Send(*MaxAmongAllResponse) error
	Recv() (*MaxAmongAllRequest, error)
	grpc.ServerStream
}

type CalculatorService_PrimeFactorizeClient

type CalculatorService_PrimeFactorizeClient interface {
	Recv() (*PrimeFactorizationResponse, error)
	grpc.ClientStream
}

type CalculatorService_PrimeFactorizeServer

type CalculatorService_PrimeFactorizeServer interface {
	Send(*PrimeFactorizationResponse) error
	grpc.ServerStream
}

type MaxAmongAllRequest

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

func (*MaxAmongAllRequest) Descriptor deprecated

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

Deprecated: Use MaxAmongAllRequest.ProtoReflect.Descriptor instead.

func (*MaxAmongAllRequest) GetNumber

func (x *MaxAmongAllRequest) GetNumber() int64

func (*MaxAmongAllRequest) ProtoMessage

func (*MaxAmongAllRequest) ProtoMessage()

func (*MaxAmongAllRequest) ProtoReflect

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

func (*MaxAmongAllRequest) Reset

func (x *MaxAmongAllRequest) Reset()

func (*MaxAmongAllRequest) String

func (x *MaxAmongAllRequest) String() string

type MaxAmongAllResponse

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

func (*MaxAmongAllResponse) Descriptor deprecated

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

Deprecated: Use MaxAmongAllResponse.ProtoReflect.Descriptor instead.

func (*MaxAmongAllResponse) GetMaxNum

func (x *MaxAmongAllResponse) GetMaxNum() int64

func (*MaxAmongAllResponse) ProtoMessage

func (*MaxAmongAllResponse) ProtoMessage()

func (*MaxAmongAllResponse) ProtoReflect

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

func (*MaxAmongAllResponse) Reset

func (x *MaxAmongAllResponse) Reset()

func (*MaxAmongAllResponse) String

func (x *MaxAmongAllResponse) String() string

type PrimeFactorizationRequeset

type PrimeFactorizationRequeset struct {
	Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*PrimeFactorizationRequeset) Descriptor deprecated

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

Deprecated: Use PrimeFactorizationRequeset.ProtoReflect.Descriptor instead.

func (*PrimeFactorizationRequeset) GetNumber

func (x *PrimeFactorizationRequeset) GetNumber() int32

func (*PrimeFactorizationRequeset) ProtoMessage

func (*PrimeFactorizationRequeset) ProtoMessage()

func (*PrimeFactorizationRequeset) ProtoReflect

func (*PrimeFactorizationRequeset) Reset

func (x *PrimeFactorizationRequeset) Reset()

func (*PrimeFactorizationRequeset) String

func (x *PrimeFactorizationRequeset) String() string

type PrimeFactorizationResponse

type PrimeFactorizationResponse struct {
	Factor int32 `protobuf:"varint,1,opt,name=factor,proto3" json:"factor,omitempty"`
	// contains filtered or unexported fields
}

func (*PrimeFactorizationResponse) Descriptor deprecated

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

Deprecated: Use PrimeFactorizationResponse.ProtoReflect.Descriptor instead.

func (*PrimeFactorizationResponse) GetFactor

func (x *PrimeFactorizationResponse) GetFactor() int32

func (*PrimeFactorizationResponse) ProtoMessage

func (*PrimeFactorizationResponse) ProtoMessage()

func (*PrimeFactorizationResponse) ProtoReflect

func (*PrimeFactorizationResponse) Reset

func (x *PrimeFactorizationResponse) Reset()

func (*PrimeFactorizationResponse) String

func (x *PrimeFactorizationResponse) String() string

type SquareRootRequest

type SquareRootRequest struct {
	Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // we should make this unsigned int // but for demo of validation we are making it signed int
	// contains filtered or unexported fields
}

func (*SquareRootRequest) Descriptor deprecated

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

Deprecated: Use SquareRootRequest.ProtoReflect.Descriptor instead.

func (*SquareRootRequest) GetNumber

func (x *SquareRootRequest) GetNumber() int32

func (*SquareRootRequest) ProtoMessage

func (*SquareRootRequest) ProtoMessage()

func (*SquareRootRequest) ProtoReflect

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

func (*SquareRootRequest) Reset

func (x *SquareRootRequest) Reset()

func (*SquareRootRequest) String

func (x *SquareRootRequest) String() string

type SquareRootResponse

type SquareRootResponse struct {
	Root float64 `protobuf:"fixed64,1,opt,name=root,proto3" json:"root,omitempty"`
	// contains filtered or unexported fields
}

func (*SquareRootResponse) Descriptor deprecated

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

Deprecated: Use SquareRootResponse.ProtoReflect.Descriptor instead.

func (*SquareRootResponse) GetRoot

func (x *SquareRootResponse) GetRoot() float64

func (*SquareRootResponse) ProtoMessage

func (*SquareRootResponse) ProtoMessage()

func (*SquareRootResponse) ProtoReflect

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

func (*SquareRootResponse) Reset

func (x *SquareRootResponse) Reset()

func (*SquareRootResponse) String

func (x *SquareRootResponse) String() string

type UnimplementedCalculatorServiceServer

type UnimplementedCalculatorServiceServer struct {
}

UnimplementedCalculatorServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCalculatorServiceServer) Average

func (UnimplementedCalculatorServiceServer) MaxAmongAll

func (UnimplementedCalculatorServiceServer) Operate

func (UnimplementedCalculatorServiceServer) Sqrt

type UnsafeCalculatorServiceServer

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

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

Jump to

Keyboard shortcuts

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