Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterGreetServiceHandler(srv *server.Server, hdlr GreetServiceHandler, opts ...server.ServiceOption) error
- func SetConsumerService(srv common.RPCService)
- func SetProviderService(srv common.RPCService)
- type GreetService
- type GreetServiceGreetClientStreamClient
- func (cli *GreetServiceGreetClientStreamClient) CloseAndRecv() (*proto.GreetClientStreamResponse, error)
- func (cli *GreetServiceGreetClientStreamClient) Conn() (triple_protocol.StreamingClientConn, error)
- func (cli *GreetServiceGreetClientStreamClient) Send(msg *proto.GreetClientStreamRequest) error
- type GreetServiceGreetClientStreamServer
- type GreetServiceGreetServerStreamClient
- type GreetServiceGreetServerStreamServer
- type GreetServiceGreetStreamClient
- type GreetServiceGreetStreamServer
- type GreetServiceHandler
- type GreetServiceImpl
- func (c *GreetServiceImpl) Greet(ctx context.Context, req *proto.GreetRequest, opts ...client.CallOption) (*proto.GreetResponse, error)
- func (c *GreetServiceImpl) GreetClientStream(ctx context.Context, opts ...client.CallOption) (GreetService_GreetClientStreamClient, error)
- func (c *GreetServiceImpl) GreetServerStream(ctx context.Context, req *proto.GreetServerStreamRequest, ...) (GreetService_GreetServerStreamClient, error)
- func (c *GreetServiceImpl) GreetStream(ctx context.Context, opts ...client.CallOption) (GreetService_GreetStreamClient, error)
- type GreetService_GreetClientStreamClient
- type GreetService_GreetClientStreamServer
- type GreetService_GreetServerStreamClient
- type GreetService_GreetServerStreamServer
- type GreetService_GreetStreamClient
- type GreetService_GreetStreamServer
Constants ¶
View Source
const ( // GreetServiceGreetProcedure is the fully-qualified name of the GreetService's Greet RPC. GreetServiceGreetProcedure = "/greet.GreetService/Greet" // GreetServiceGreetStreamProcedure is the fully-qualified name of the GreetService's GreetStream // RPC. GreetServiceGreetStreamProcedure = "/greet.GreetService/GreetStream" // GreetServiceGreetClientStreamProcedure is the fully-qualified name of the GreetService's // GreetClientStream RPC. GreetServiceGreetClientStreamProcedure = "/greet.GreetService/GreetClientStream" // GreetServiceGreetServerStreamProcedure is the fully-qualified name of the GreetService's // GreetServerStream RPC. GreetServiceGreetServerStreamProcedure = "/greet.GreetService/GreetServerStream" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
View Source
const (
// GreetServiceName is the fully-qualified name of the GreetService service.
GreetServiceName = "greet.GreetService"
)
Variables ¶
View Source
var GreetService_ClientInfo = client.ClientInfo{ InterfaceName: "greet.GreetService", MethodNames: []string{"Greet", "GreetStream", "GreetClientStream", "GreetServerStream"}, ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) { dubboCli := dubboCliRaw.(GreetServiceImpl) dubboCli.conn = conn }, }
View Source
var GreetService_ServiceInfo = server.ServiceInfo{ InterfaceName: "greet.GreetService", ServiceType: (*GreetServiceHandler)(nil), Methods: []server.MethodInfo{ { Name: "Greet", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(proto.GreetRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*proto.GreetRequest) res, err := handler.(GreetServiceHandler).Greet(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "GreetStream", Type: constant.CallBidiStream, StreamInitFunc: func(baseStream interface{}) interface{} { return &GreetServiceGreetStreamServer{baseStream.(*triple_protocol.BidiStream)} }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { stream := args[0].(GreetService_GreetStreamServer) if err := handler.(GreetServiceHandler).GreetStream(ctx, stream); err != nil { return nil, err } return nil, nil }, }, { Name: "GreetClientStream", Type: constant.CallClientStream, StreamInitFunc: func(baseStream interface{}) interface{} { return &GreetServiceGreetClientStreamServer{baseStream.(*triple_protocol.ClientStream)} }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { stream := args[0].(GreetService_GreetClientStreamServer) res, err := handler.(GreetServiceHandler).GreetClientStream(ctx, stream) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "GreetServerStream", Type: constant.CallServerStream, ReqInitFunc: func() interface{} { return new(proto.GreetServerStreamRequest) }, StreamInitFunc: func(baseStream interface{}) interface{} { return &GreetServiceGreetServerStreamServer{baseStream.(*triple_protocol.ServerStream)} }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*proto.GreetServerStreamRequest) stream := args[1].(GreetService_GreetServerStreamServer) if err := handler.(GreetServiceHandler).GreetServerStream(ctx, req, stream); err != nil { return nil, err } return nil, nil }, }, }, }
Functions ¶
func RegisterGreetServiceHandler ¶
func RegisterGreetServiceHandler(srv *server.Server, hdlr GreetServiceHandler, opts ...server.ServiceOption) error
func SetConsumerService ¶
func SetConsumerService(srv common.RPCService)
func SetProviderService ¶
func SetProviderService(srv common.RPCService)
Types ¶
type GreetService ¶
type GreetService interface { Greet(ctx context.Context, req *proto.GreetRequest, opts ...client.CallOption) (*proto.GreetResponse, error) GreetStream(ctx context.Context, opts ...client.CallOption) (GreetService_GreetStreamClient, error) GreetClientStream(ctx context.Context, opts ...client.CallOption) (GreetService_GreetClientStreamClient, error) GreetServerStream(ctx context.Context, req *proto.GreetServerStreamRequest, opts ...client.CallOption) (GreetService_GreetServerStreamClient, error) }
GreetService is a client for the greet.GreetService service.
func NewGreetService ¶
func NewGreetService(cli *client.Client, opts ...client.ReferenceOption) (GreetService, error)
NewGreetService constructs a client for the greet.GreetService service.
type GreetServiceGreetClientStreamClient ¶
type GreetServiceGreetClientStreamClient struct {
*triple_protocol.ClientStreamForClient
}
func (*GreetServiceGreetClientStreamClient) CloseAndRecv ¶
func (cli *GreetServiceGreetClientStreamClient) CloseAndRecv() (*proto.GreetClientStreamResponse, error)
func (*GreetServiceGreetClientStreamClient) Conn ¶
func (cli *GreetServiceGreetClientStreamClient) Conn() (triple_protocol.StreamingClientConn, error)
func (*GreetServiceGreetClientStreamClient) Send ¶
func (cli *GreetServiceGreetClientStreamClient) Send(msg *proto.GreetClientStreamRequest) error
type GreetServiceGreetClientStreamServer ¶
type GreetServiceGreetClientStreamServer struct {
*triple_protocol.ClientStream
}
func (*GreetServiceGreetClientStreamServer) Msg ¶
func (srv *GreetServiceGreetClientStreamServer) Msg() *proto.GreetClientStreamRequest
func (*GreetServiceGreetClientStreamServer) Recv ¶
func (srv *GreetServiceGreetClientStreamServer) Recv() bool
type GreetServiceGreetServerStreamClient ¶
type GreetServiceGreetServerStreamClient struct {
*triple_protocol.ServerStreamForClient
}
func (*GreetServiceGreetServerStreamClient) Conn ¶
func (cli *GreetServiceGreetServerStreamClient) Conn() (triple_protocol.StreamingClientConn, error)
func (*GreetServiceGreetServerStreamClient) Msg ¶
func (cli *GreetServiceGreetServerStreamClient) Msg() *proto.GreetServerStreamResponse
func (*GreetServiceGreetServerStreamClient) Recv ¶
func (cli *GreetServiceGreetServerStreamClient) Recv() bool
type GreetServiceGreetServerStreamServer ¶
type GreetServiceGreetServerStreamServer struct {
*triple_protocol.ServerStream
}
func (*GreetServiceGreetServerStreamServer) Send ¶
func (g *GreetServiceGreetServerStreamServer) Send(msg *proto.GreetServerStreamResponse) error
type GreetServiceGreetStreamClient ¶
type GreetServiceGreetStreamClient struct {
*triple_protocol.BidiStreamForClient
}
func (*GreetServiceGreetStreamClient) Recv ¶
func (cli *GreetServiceGreetStreamClient) Recv() (*proto.GreetStreamResponse, error)
func (*GreetServiceGreetStreamClient) Send ¶
func (cli *GreetServiceGreetStreamClient) Send(msg *proto.GreetStreamRequest) error
type GreetServiceGreetStreamServer ¶
type GreetServiceGreetStreamServer struct {
*triple_protocol.BidiStream
}
func (GreetServiceGreetStreamServer) Recv ¶
func (srv GreetServiceGreetStreamServer) Recv() (*proto.GreetStreamRequest, error)
func (*GreetServiceGreetStreamServer) Send ¶
func (srv *GreetServiceGreetStreamServer) Send(msg *proto.GreetStreamResponse) error
type GreetServiceHandler ¶
type GreetServiceHandler interface { Greet(context.Context, *proto.GreetRequest) (*proto.GreetResponse, error) GreetStream(context.Context, GreetService_GreetStreamServer) error GreetClientStream(context.Context, GreetService_GreetClientStreamServer) (*proto.GreetClientStreamResponse, error) GreetServerStream(context.Context, *proto.GreetServerStreamRequest, GreetService_GreetServerStreamServer) error }
GreetServiceHandler is an implementation of the greet.GreetService service.
type GreetServiceImpl ¶
type GreetServiceImpl struct {
// contains filtered or unexported fields
}
GreetServiceImpl implements GreetService.
func (*GreetServiceImpl) Greet ¶
func (c *GreetServiceImpl) Greet(ctx context.Context, req *proto.GreetRequest, opts ...client.CallOption) (*proto.GreetResponse, error)
func (*GreetServiceImpl) GreetClientStream ¶
func (c *GreetServiceImpl) GreetClientStream(ctx context.Context, opts ...client.CallOption) (GreetService_GreetClientStreamClient, error)
func (*GreetServiceImpl) GreetServerStream ¶
func (c *GreetServiceImpl) GreetServerStream(ctx context.Context, req *proto.GreetServerStreamRequest, opts ...client.CallOption) (GreetService_GreetServerStreamClient, error)
func (*GreetServiceImpl) GreetStream ¶
func (c *GreetServiceImpl) GreetStream(ctx context.Context, opts ...client.CallOption) (GreetService_GreetStreamClient, error)
type GreetService_GreetClientStreamClient ¶
type GreetService_GreetClientStreamClient interface { Spec() triple_protocol.Spec Peer() triple_protocol.Peer Send(*proto.GreetClientStreamRequest) error RequestHeader() http.Header CloseAndRecv() (*proto.GreetClientStreamResponse, error) Conn() (triple_protocol.StreamingClientConn, error) }
type GreetService_GreetClientStreamServer ¶
type GreetService_GreetClientStreamServer interface { Spec() triple_protocol.Spec Peer() triple_protocol.Peer Recv() bool RequestHeader() http.Header Msg() *proto.GreetClientStreamRequest Err() error Conn() triple_protocol.StreamingHandlerConn }
type GreetService_GreetServerStreamClient ¶
type GreetService_GreetServerStreamClient interface { Recv() bool ResponseHeader() http.Header ResponseTrailer() http.Header Msg() *proto.GreetServerStreamResponse Err() error Conn() (triple_protocol.StreamingClientConn, error) Close() error }
type GreetService_GreetServerStreamServer ¶
type GreetService_GreetServerStreamServer interface { Send(*proto.GreetServerStreamResponse) error ResponseHeader() http.Header ResponseTrailer() http.Header Conn() triple_protocol.StreamingHandlerConn }
type GreetService_GreetStreamClient ¶
type GreetService_GreetStreamClient interface { Spec() triple_protocol.Spec Peer() triple_protocol.Peer Send(*proto.GreetStreamRequest) error RequestHeader() http.Header CloseRequest() error Recv() (*proto.GreetStreamResponse, error) ResponseHeader() http.Header ResponseTrailer() http.Header CloseResponse() error }
type GreetService_GreetStreamServer ¶
type GreetService_GreetStreamServer interface { Send(*proto.GreetStreamResponse) error Recv() (*proto.GreetStreamRequest, error) Spec() triple_protocol.Spec Peer() triple_protocol.Peer RequestHeader() http.Header ResponseHeader() http.Header ResponseTrailer() http.Header Conn() triple_protocol.StreamingHandlerConn }
Click to show internal directories.
Click to hide internal directories.