Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into JSON-RPC 2.0
Index ¶
Constants ¶
const (
EchoService_Echo_FullMethodName = "/proto.EchoService/Echo"
)
Variables ¶
var ( EchoType_name = map[int32]string{ 0: "FOO", 1: "BAR", } EchoType_value = map[string]int32{ "FOO": 0, "BAR": 1, } )
Enum value maps for EchoType.
var EchoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.EchoService", HandlerType: (*EchoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _EchoService_Echo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "echo.proto", }
EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_echo_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServiceServer ¶
func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type EchoType `protobuf:"varint,2,opt,name=type,proto3,enum=proto.EchoType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetName ¶
func (x *EchoRequest) GetName() string
func (*EchoRequest) GetType ¶ added in v0.5.0
func (x *EchoRequest) GetType() EchoType
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetMessage ¶
func (x *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
type EchoServiceClient ¶
type EchoServiceClient interface {
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
}
EchoServiceClient is the client API for EchoService 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 NewEchoServiceClient ¶
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient
type EchoServiceJsonRPC ¶ added in v0.3.2
type EchoServiceJsonRPC struct {
// contains filtered or unexported fields
}
func RegisterEchoServiceJsonRPC ¶ added in v0.3.2
func RegisterEchoServiceJsonRPC(conn *grpc.ClientConn) *EchoServiceJsonRPC
RegisterEchoServiceJsonRPC register the grpc client EchoService for json-rpc. The handlers forward requests to the grpc endpoint over "conn".
func (*EchoServiceJsonRPC) Methods ¶ added in v0.3.2
func (s *EchoServiceJsonRPC) Methods() map[string]func(ctx context.Context, message json.RawMessage) (any, error)
type EchoServiceServer ¶
type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) // contains filtered or unexported methods }
EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility
type EchoType ¶ added in v0.5.0
type EchoType int32
func (EchoType) Descriptor ¶ added in v0.5.0
func (EchoType) Descriptor() protoreflect.EnumDescriptor
func (EchoType) EnumDescriptor
deprecated
added in
v0.5.0
func (EchoType) Number ¶ added in v0.5.0
func (x EchoType) Number() protoreflect.EnumNumber
func (EchoType) Type ¶ added in v0.5.0
func (EchoType) Type() protoreflect.EnumType
type UnimplementedEchoServiceServer ¶
type UnimplementedEchoServiceServer struct { }
UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedEchoServiceServer) Echo ¶
func (UnimplementedEchoServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
type UnsafeEchoServiceServer ¶
type UnsafeEchoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServiceServer will result in compilation errors.