Documentation ¶
Index ¶
- Constants
- Variables
- func ProtoDemoClientRoutes(cli ProtoDemoClient, opts ...gors.Option) []gors.Route
- func ProtoDemoServerRoutes(srv ProtoDemoServer, opts ...gors.Option) []gors.Route
- func RegisterProtoDemoServer(s grpc.ServiceRegistrar, srv ProtoDemoServer)
- type CommonReply
- func (*CommonReply) Descriptor() ([]byte, []int)deprecated
- func (x *CommonReply) GetCode() int32
- func (x *CommonReply) GetData() *anypb.Any
- func (x *CommonReply) GetMsg() string
- func (*CommonReply) ProtoMessage()
- func (x *CommonReply) ProtoReflect() protoreflect.Message
- func (x *CommonReply) Reset()
- func (x *CommonReply) String() string
- type HelloReply
- func (*HelloReply) Descriptor() ([]byte, []int)deprecated
- func (x *HelloReply) GetMessage() string
- func (*HelloReply) ProtoMessage()
- func (x *HelloReply) ProtoReflect() protoreflect.Message
- func (reply *HelloReply) Render(ctx context.Context)
- func (x *HelloReply) Reset()
- func (x *HelloReply) String() string
- type HelloRequest
- func (req *HelloRequest) Bind(ctx context.Context) error
- func (*HelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequest) GetAge() int32
- func (x *HelloRequest) GetName() string
- func (x *HelloRequest) GetSalary() float64
- func (x *HelloRequest) GetToken() string
- func (*HelloRequest) ProtoMessage()
- func (x *HelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloRequest) Reset()
- func (x *HelloRequest) String() string
- type ProtoDemoClient
- type ProtoDemoServer
- type UnimplementedProtoDemoServer
- func (UnimplementedProtoDemoServer) DELETEUriBindingJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) GETUriBindingIndentedJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) GETUriQueryBindingSecureJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) NotDefine(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) PATCHHeaderProtoFormBindingPureJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) POSTCustomBindingCustomRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) POSTError(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) POSTGRPCStatus(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) POSTProtoBufBindingProtoBufRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) POSTProtoJSONBindingProtoJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) POSTSetHeaderTrailer(context.Context, *HelloRequest) (*HelloReply, error)
- func (UnimplementedProtoDemoServer) PUTHeaderJSONBindingAsciiJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
- type UnsafeProtoDemoServer
Constants ¶
const ( ProtoDemo_DELETEUriBindingJSONRender_FullMethodName = "/protodemo.ProtoDemo/DELETEUriBindingJSONRender" ProtoDemo_GETUriBindingIndentedJSONRender_FullMethodName = "/protodemo.ProtoDemo/GETUriBindingIndentedJSONRender" ProtoDemo_GETUriQueryBindingSecureJSONRender_FullMethodName = "/protodemo.ProtoDemo/GETUriQueryBindingSecureJSONRender" ProtoDemo_PATCHHeaderProtoFormBindingPureJSONRender_FullMethodName = "/protodemo.ProtoDemo/PATCHHeaderProtoFormBindingPureJSONRender" ProtoDemo_PUTHeaderJSONBindingAsciiJSONRender_FullMethodName = "/protodemo.ProtoDemo/PUTHeaderJSONBindingAsciiJSONRender" ProtoDemo_POSTProtoBufBindingProtoBufRender_FullMethodName = "/protodemo.ProtoDemo/POSTProtoBufBindingProtoBufRender" ProtoDemo_POSTProtoJSONBindingProtoJSONRender_FullMethodName = "/protodemo.ProtoDemo/POSTProtoJSONBindingProtoJSONRender" ProtoDemo_POSTCustomBindingCustomRender_FullMethodName = "/protodemo.ProtoDemo/POSTCustomBindingCustomRender" ProtoDemo_NotDefine_FullMethodName = "/protodemo.ProtoDemo/NotDefine" ProtoDemo_POSTSetHeaderTrailer_FullMethodName = "/protodemo.ProtoDemo/POSTSetHeaderTrailer" ProtoDemo_POSTError_FullMethodName = "/protodemo.ProtoDemo/POSTError" ProtoDemo_POSTGRPCStatus_FullMethodName = "/protodemo.ProtoDemo/POSTGRPCStatus" )
Variables ¶
var File_example_api_protodemo_protodemo_proto protoreflect.FileDescriptor
var ProtoDemo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "protodemo.ProtoDemo", HandlerType: (*ProtoDemoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "DELETEUriBindingJSONRender", Handler: _ProtoDemo_DELETEUriBindingJSONRender_Handler, }, { MethodName: "GETUriBindingIndentedJSONRender", Handler: _ProtoDemo_GETUriBindingIndentedJSONRender_Handler, }, { MethodName: "GETUriQueryBindingSecureJSONRender", Handler: _ProtoDemo_GETUriQueryBindingSecureJSONRender_Handler, }, { MethodName: "PATCHHeaderProtoFormBindingPureJSONRender", Handler: _ProtoDemo_PATCHHeaderProtoFormBindingPureJSONRender_Handler, }, { MethodName: "PUTHeaderJSONBindingAsciiJSONRender", Handler: _ProtoDemo_PUTHeaderJSONBindingAsciiJSONRender_Handler, }, { MethodName: "POSTProtoBufBindingProtoBufRender", Handler: _ProtoDemo_POSTProtoBufBindingProtoBufRender_Handler, }, { MethodName: "POSTProtoJSONBindingProtoJSONRender", Handler: _ProtoDemo_POSTProtoJSONBindingProtoJSONRender_Handler, }, { MethodName: "POSTCustomBindingCustomRender", Handler: _ProtoDemo_POSTCustomBindingCustomRender_Handler, }, { MethodName: "NotDefine", Handler: _ProtoDemo_NotDefine_Handler, }, { MethodName: "POSTSetHeaderTrailer", Handler: _ProtoDemo_POSTSetHeaderTrailer_Handler, }, { MethodName: "POSTError", Handler: _ProtoDemo_POSTError_Handler, }, { MethodName: "POSTGRPCStatus", Handler: _ProtoDemo_POSTGRPCStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "example/api/protodemo/protodemo.proto", }
ProtoDemo_ServiceDesc is the grpc.ServiceDesc for ProtoDemo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func ProtoDemoClientRoutes ¶
func ProtoDemoClientRoutes(cli ProtoDemoClient, opts ...gors.Option) []gors.Route
func ProtoDemoServerRoutes ¶
func ProtoDemoServerRoutes(srv ProtoDemoServer, opts ...gors.Option) []gors.Route
func RegisterProtoDemoServer ¶
func RegisterProtoDemoServer(s grpc.ServiceRegistrar, srv ProtoDemoServer)
Types ¶
type CommonReply ¶
type CommonReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data *anypb.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CommonReply) Descriptor
deprecated
func (*CommonReply) Descriptor() ([]byte, []int)
Deprecated: Use CommonReply.ProtoReflect.Descriptor instead.
func (*CommonReply) GetCode ¶
func (x *CommonReply) GetCode() int32
func (*CommonReply) GetData ¶
func (x *CommonReply) GetData() *anypb.Any
func (*CommonReply) GetMsg ¶
func (x *CommonReply) GetMsg() string
func (*CommonReply) ProtoMessage ¶
func (*CommonReply) ProtoMessage()
func (*CommonReply) ProtoReflect ¶
func (x *CommonReply) ProtoReflect() protoreflect.Message
func (*CommonReply) Reset ¶
func (x *CommonReply) Reset()
func (*CommonReply) String ¶
func (x *CommonReply) String() string
type HelloReply ¶
type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*HelloReply) Descriptor
deprecated
func (*HelloReply) Descriptor() ([]byte, []int)
Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
func (*HelloReply) GetMessage ¶
func (x *HelloReply) GetMessage() string
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) ProtoReflect ¶
func (x *HelloReply) ProtoReflect() protoreflect.Message
func (*HelloReply) Render ¶
func (reply *HelloReply) Render(ctx context.Context)
func (*HelloReply) Reset ¶
func (x *HelloReply) Reset()
func (*HelloReply) String ¶
func (x *HelloReply) String() string
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` Salary float64 `protobuf:"fixed64,3,opt,name=salary,proto3" json:"salary,omitempty"` Token string `protobuf:"bytes,4,opt,name=Token,proto3" json:"Token,omitempty"` // contains filtered or unexported fields }
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetAge ¶
func (x *HelloRequest) GetAge() int32
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) GetSalary ¶
func (x *HelloRequest) GetSalary() float64
func (*HelloRequest) GetToken ¶
func (x *HelloRequest) GetToken() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
type ProtoDemoClient ¶
type ProtoDemoClient interface { // @GORS @DELETE @Path(/UriBinding/JSONRender/:name) @UriBinding @JSONRender DELETEUriBindingJSONRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @GET @Path(/UriBinding/IndentedJSONRender/:name) @UriBinding @IndentedJSONRender GETUriBindingIndentedJSONRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @GET @Path(/UriQueryBinding/SecureJSONRender/:name) @UriBinding @QueryBinding @SecureJSONRender GETUriQueryBindingSecureJSONRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @PATCH @Path(/HeaderProtoFormBinding/PureJSONRender) @HeaderBinding @FormBinding @PureJSONRender PATCHHeaderProtoFormBindingPureJSONRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @PUT @Path(/HeaderJSONBinding/AsciiJSONRender) @HeaderBinding @JSONBinding @AsciiJSONRender PUTHeaderJSONBindingAsciiJSONRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @POST @Path(/ProtoBufBinding/ProtoBufRender) @ProtoBufBinding @ProtoBufRender POSTProtoBufBindingProtoBufRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @POST @Path(/ProtoJSONBinding/ProtoJSONRender) @ProtoJSONBinding @ProtoJSONRender POSTProtoJSONBindingProtoJSONRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @POST @Path(/CustomBinding/CustomRender) @CustomBinding @CustomRender POSTCustomBindingCustomRender(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) NotDefine(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @POST @Path(/POSTSetHeaderTrailer) @ProtoJSONBinding @ProtoJSONRender POSTSetHeaderTrailer(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @POST @Path(/Error) @ProtoJSONBinding @ProtoJSONRender POSTError(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // @GORS @POST @Path(/GRPCStatus) @ProtoJSONBinding @ProtoJSONRender POSTGRPCStatus(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) }
ProtoDemoClient is the client API for ProtoDemo 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 NewProtoDemoClient ¶
func NewProtoDemoClient(cc grpc.ClientConnInterface) ProtoDemoClient
type ProtoDemoServer ¶
type ProtoDemoServer interface { // @GORS @DELETE @Path(/UriBinding/JSONRender/:name) @UriBinding @JSONRender DELETEUriBindingJSONRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @GET @Path(/UriBinding/IndentedJSONRender/:name) @UriBinding @IndentedJSONRender GETUriBindingIndentedJSONRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @GET @Path(/UriQueryBinding/SecureJSONRender/:name) @UriBinding @QueryBinding @SecureJSONRender GETUriQueryBindingSecureJSONRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @PATCH @Path(/HeaderProtoFormBinding/PureJSONRender) @HeaderBinding @FormBinding @PureJSONRender PATCHHeaderProtoFormBindingPureJSONRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @PUT @Path(/HeaderJSONBinding/AsciiJSONRender) @HeaderBinding @JSONBinding @AsciiJSONRender PUTHeaderJSONBindingAsciiJSONRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @POST @Path(/ProtoBufBinding/ProtoBufRender) @ProtoBufBinding @ProtoBufRender POSTProtoBufBindingProtoBufRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @POST @Path(/ProtoJSONBinding/ProtoJSONRender) @ProtoJSONBinding @ProtoJSONRender POSTProtoJSONBindingProtoJSONRender(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @POST @Path(/CustomBinding/CustomRender) @CustomBinding @CustomRender POSTCustomBindingCustomRender(context.Context, *HelloRequest) (*HelloReply, error) NotDefine(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @POST @Path(/POSTSetHeaderTrailer) @ProtoJSONBinding @ProtoJSONRender POSTSetHeaderTrailer(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @POST @Path(/Error) @ProtoJSONBinding @ProtoJSONRender POSTError(context.Context, *HelloRequest) (*HelloReply, error) // @GORS @POST @Path(/GRPCStatus) @ProtoJSONBinding @ProtoJSONRender POSTGRPCStatus(context.Context, *HelloRequest) (*HelloReply, error) // contains filtered or unexported methods }
ProtoDemoServer is the server API for ProtoDemo service. All implementations must embed UnimplementedProtoDemoServer for forward compatibility
type UnimplementedProtoDemoServer ¶
type UnimplementedProtoDemoServer struct { }
UnimplementedProtoDemoServer must be embedded to have forward compatible implementations.
func (UnimplementedProtoDemoServer) DELETEUriBindingJSONRender ¶
func (UnimplementedProtoDemoServer) DELETEUriBindingJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) GETUriBindingIndentedJSONRender ¶
func (UnimplementedProtoDemoServer) GETUriBindingIndentedJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) GETUriQueryBindingSecureJSONRender ¶
func (UnimplementedProtoDemoServer) GETUriQueryBindingSecureJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) NotDefine ¶
func (UnimplementedProtoDemoServer) NotDefine(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) PATCHHeaderProtoFormBindingPureJSONRender ¶
func (UnimplementedProtoDemoServer) PATCHHeaderProtoFormBindingPureJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) POSTCustomBindingCustomRender ¶
func (UnimplementedProtoDemoServer) POSTCustomBindingCustomRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) POSTError ¶
func (UnimplementedProtoDemoServer) POSTError(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) POSTGRPCStatus ¶
func (UnimplementedProtoDemoServer) POSTGRPCStatus(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) POSTProtoBufBindingProtoBufRender ¶
func (UnimplementedProtoDemoServer) POSTProtoBufBindingProtoBufRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) POSTProtoJSONBindingProtoJSONRender ¶
func (UnimplementedProtoDemoServer) POSTProtoJSONBindingProtoJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) POSTSetHeaderTrailer ¶
func (UnimplementedProtoDemoServer) POSTSetHeaderTrailer(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedProtoDemoServer) PUTHeaderJSONBindingAsciiJSONRender ¶
func (UnimplementedProtoDemoServer) PUTHeaderJSONBindingAsciiJSONRender(context.Context, *HelloRequest) (*HelloReply, error)
type UnsafeProtoDemoServer ¶
type UnsafeProtoDemoServer interface {
// contains filtered or unexported methods
}
UnsafeProtoDemoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProtoDemoServer will result in compilation errors.