api

package
v0.0.0-...-3659004 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_samples_api_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc_go.ServiceDesc{
	ServiceName: "org.apache.dubbogo.samples.api.Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc_go.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Greeter_SayHello_Handler,
		},
	},
	Streams: []grpc_go.StreamDesc{
		{
			StreamName:    "SayHelloStream",
			Handler:       _Greeter_SayHelloStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "samples_api.proto",
}

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

Functions

func RegisterGreeterServer

func RegisterGreeterServer(s grpc_go.ServiceRegistrar, srv GreeterServer)

Types

type GreeterClient

type GreeterClient interface {
	// Sends a greeting
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc_go.CallOption) (*User, common.ErrorWithAttachment)
	// Sends a greeting via stream
	SayHelloStream(ctx context.Context, opts ...grpc_go.CallOption) (Greeter_SayHelloStreamClient, error)
}

GreeterClient is the client API for Greeter 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 NewGreeterClient

func NewGreeterClient(cc *triple.TripleConn) GreeterClient

type GreeterClientImpl

type GreeterClientImpl struct {
	SayHello       func(ctx context.Context, in *HelloRequest) (*User, error)
	SayHelloStream func(ctx context.Context) (Greeter_SayHelloStreamClient, error)
}

func (*GreeterClientImpl) GetDubboStub

func (c *GreeterClientImpl) GetDubboStub(cc *triple.TripleConn) GreeterClient

func (*GreeterClientImpl) XXX_InterfaceName

func (c *GreeterClientImpl) XXX_InterfaceName() string

type GreeterServer

type GreeterServer interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest) (*User, error)
	// Sends a greeting via stream
	SayHelloStream(Greeter_SayHelloStreamServer) error
	// contains filtered or unexported methods
}

GreeterServer is the server API for Greeter service. All implementations must embed UnimplementedGreeterServer for forward compatibility

type Greeter_SayHelloStreamClient

type Greeter_SayHelloStreamClient interface {
	Send(*HelloRequest) error
	Recv() (*User, error)
	grpc_go.ClientStream
}

type Greeter_SayHelloStreamServer

type Greeter_SayHelloStreamServer interface {
	Send(*User) error
	Recv() (*HelloRequest, error)
	grpc_go.ServerStream
}

type HelloRequest

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

The request message containing the user's name.

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() 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 UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
	// contains filtered or unexported fields
}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) SayHello

func (UnimplementedGreeterServer) SayHelloStream

func (*UnimplementedGreeterServer) XXX_GetProxyImpl

func (s *UnimplementedGreeterServer) XXX_GetProxyImpl() protocol.Invoker

func (*UnimplementedGreeterServer) XXX_InterfaceName

func (s *UnimplementedGreeterServer) XXX_InterfaceName() string

func (*UnimplementedGreeterServer) XXX_ServiceDesc

func (s *UnimplementedGreeterServer) XXX_ServiceDesc() *grpc_go.ServiceDesc

func (*UnimplementedGreeterServer) XXX_SetProxyImpl

func (s *UnimplementedGreeterServer) XXX_SetProxyImpl(impl protocol.Invoker)

type UnsafeGreeterServer

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

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

type User

type User struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Id   string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Age  int32  `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
	// contains filtered or unexported fields
}

The response message containing the greetings

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAge

func (x *User) GetAge() int32

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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