Documentation ¶
Index ¶
- Variables
- func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)
- func RegisterSkuServiceServer(s grpc.ServiceRegistrar, srv SkuServiceServer)
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type HelloRequest
- type HelloResponse
- type HelloServiceClient
- type HelloServiceServer
- type Sku
- type SkuServiceClient
- type SkuServiceServer
- type UnimplementedHelloServiceServer
- type UnimplementedSkuServiceServer
- type UnimplementedUserServiceServer
- type UnsafeHelloServiceServer
- type UnsafeSkuServiceServer
- type UnsafeUserServiceServer
- type User
- type UserServiceClient
- type UserServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_protos_hello_proto protoreflect.FileDescriptor
var File_protos_sku_proto protoreflect.FileDescriptor
var File_protos_user_proto protoreflect.FileDescriptor
var HelloService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "HelloService", HandlerType: (*HelloServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _HelloService_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "protos/hello.proto", }
HelloService_ServiceDesc is the grpc.ServiceDesc for HelloService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var SkuService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "SkuService", HandlerType: (*SkuServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "DecreaseStock", Handler: _SkuService_DecreaseStock_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "protos/sku.proto", }
SkuService_ServiceDesc is the grpc.ServiceDesc for SkuService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "protos/user.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHelloServiceServer ¶
func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)
func RegisterSkuServiceServer ¶
func RegisterSkuServiceServer(s grpc.ServiceRegistrar, srv SkuServiceServer)
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
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 HelloResponse ¶
type HelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetMessage ¶
func (x *HelloResponse) GetMessage() string
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
type HelloServiceClient ¶
type HelloServiceClient interface {
SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}
HelloServiceClient is the client API for HelloService 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 NewHelloServiceClient ¶
func NewHelloServiceClient(cc grpc.ClientConnInterface) HelloServiceClient
type HelloServiceServer ¶
type HelloServiceServer interface { SayHello(context.Context, *HelloRequest) (*HelloResponse, error) // contains filtered or unexported methods }
HelloServiceServer is the server API for HelloService service. All implementations must embed UnimplementedHelloServiceServer for forward compatibility
type Sku ¶
type Sku struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` Price int32 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` Num int32 `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"` // contains filtered or unexported fields }
func (*Sku) Descriptor
deprecated
func (*Sku) ProtoMessage ¶
func (*Sku) ProtoMessage()
func (*Sku) ProtoReflect ¶
func (x *Sku) ProtoReflect() protoreflect.Message
type SkuServiceClient ¶
type SkuServiceClient interface {
DecreaseStock(ctx context.Context, in *Sku, opts ...grpc.CallOption) (*Sku, error)
}
SkuServiceClient is the client API for SkuService 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 NewSkuServiceClient ¶
func NewSkuServiceClient(cc grpc.ClientConnInterface) SkuServiceClient
type SkuServiceServer ¶
type SkuServiceServer interface { DecreaseStock(context.Context, *Sku) (*Sku, error) // contains filtered or unexported methods }
SkuServiceServer is the server API for SkuService service. All implementations must embed UnimplementedSkuServiceServer for forward compatibility
type UnimplementedHelloServiceServer ¶
type UnimplementedHelloServiceServer struct { }
UnimplementedHelloServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHelloServiceServer) SayHello ¶
func (UnimplementedHelloServiceServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
type UnimplementedSkuServiceServer ¶
type UnimplementedSkuServiceServer struct { }
UnimplementedSkuServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedSkuServiceServer) DecreaseStock ¶
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
type UnsafeHelloServiceServer ¶
type UnsafeHelloServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHelloServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloServiceServer will result in compilation errors.
type UnsafeSkuServiceServer ¶
type UnsafeSkuServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSkuServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SkuServiceServer will result in compilation errors.
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type User ¶
type User struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface {
GetUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error)
}
UserServiceClient is the client API for UserService 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 NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { GetUser(context.Context, *User) (*User, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility