Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterGoodsServiceHTTPServer(s *http.Server, srv GoodsServiceHTTPServer)
- func RegisterGoodsServiceServer(s grpc.ServiceRegistrar, srv GoodsServiceServer)
- type BuyGoodsRequest
- func (*BuyGoodsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BuyGoodsRequest) GetGoodsID() int64
- func (x *BuyGoodsRequest) GetRequestID() string
- func (*BuyGoodsRequest) ProtoMessage()
- func (x *BuyGoodsRequest) ProtoReflect() protoreflect.Message
- func (x *BuyGoodsRequest) Reset()
- func (x *BuyGoodsRequest) String() string
- func (m *BuyGoodsRequest) Validate() error
- func (m *BuyGoodsRequest) ValidateAll() error
- type BuyGoodsRequestMultiError
- type BuyGoodsRequestValidationError
- func (e BuyGoodsRequestValidationError) Cause() error
- func (e BuyGoodsRequestValidationError) Error() string
- func (e BuyGoodsRequestValidationError) ErrorName() string
- func (e BuyGoodsRequestValidationError) Field() string
- func (e BuyGoodsRequestValidationError) Key() bool
- func (e BuyGoodsRequestValidationError) Reason() string
- type GoodsServiceClient
- type GoodsServiceHTTPClient
- type GoodsServiceHTTPClientImpl
- type GoodsServiceHTTPServer
- type GoodsServiceServer
- type UnimplementedGoodsServiceServer
- type UnsafeGoodsServiceServer
Constants ¶
const OperationGoodsServiceBuyGoods = "/client_web.v1.goods.GoodsService/BuyGoods"
Variables ¶
var File_client_web_v1_goods_client_goods_proto protoreflect.FileDescriptor
var GoodsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "client_web.v1.goods.GoodsService", HandlerType: (*GoodsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "BuyGoods", Handler: _GoodsService_BuyGoods_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "client-web/v1/goods/client-goods.proto", }
GoodsService_ServiceDesc is the grpc.ServiceDesc for GoodsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGoodsServiceHTTPServer ¶ added in v1.0.2
func RegisterGoodsServiceHTTPServer(s *http.Server, srv GoodsServiceHTTPServer)
func RegisterGoodsServiceServer ¶ added in v1.0.2
func RegisterGoodsServiceServer(s grpc.ServiceRegistrar, srv GoodsServiceServer)
Types ¶
type BuyGoodsRequest ¶
type BuyGoodsRequest struct { RequestID string `protobuf:"bytes,1,opt,name=RequestID,proto3" json:"RequestID,omitempty"` GoodsID int64 `protobuf:"varint,2,opt,name=GoodsID,proto3" json:"GoodsID,omitempty"` //购买的商品ID // contains filtered or unexported fields }
func (*BuyGoodsRequest) Descriptor
deprecated
func (*BuyGoodsRequest) Descriptor() ([]byte, []int)
Deprecated: Use BuyGoodsRequest.ProtoReflect.Descriptor instead.
func (*BuyGoodsRequest) GetGoodsID ¶
func (x *BuyGoodsRequest) GetGoodsID() int64
func (*BuyGoodsRequest) GetRequestID ¶
func (x *BuyGoodsRequest) GetRequestID() string
func (*BuyGoodsRequest) ProtoMessage ¶
func (*BuyGoodsRequest) ProtoMessage()
func (*BuyGoodsRequest) ProtoReflect ¶
func (x *BuyGoodsRequest) ProtoReflect() protoreflect.Message
func (*BuyGoodsRequest) Reset ¶
func (x *BuyGoodsRequest) Reset()
func (*BuyGoodsRequest) String ¶
func (x *BuyGoodsRequest) String() string
func (*BuyGoodsRequest) Validate ¶
func (m *BuyGoodsRequest) Validate() error
Validate checks the field values on BuyGoodsRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*BuyGoodsRequest) ValidateAll ¶
func (m *BuyGoodsRequest) ValidateAll() error
ValidateAll checks the field values on BuyGoodsRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in BuyGoodsRequestMultiError, or nil if none found.
type BuyGoodsRequestMultiError ¶
type BuyGoodsRequestMultiError []error
BuyGoodsRequestMultiError is an error wrapping multiple validation errors returned by BuyGoodsRequest.ValidateAll() if the designated constraints aren't met.
func (BuyGoodsRequestMultiError) AllErrors ¶
func (m BuyGoodsRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (BuyGoodsRequestMultiError) Error ¶
func (m BuyGoodsRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type BuyGoodsRequestValidationError ¶
type BuyGoodsRequestValidationError struct {
// contains filtered or unexported fields
}
BuyGoodsRequestValidationError is the validation error returned by BuyGoodsRequest.Validate if the designated constraints aren't met.
func (BuyGoodsRequestValidationError) Cause ¶
func (e BuyGoodsRequestValidationError) Cause() error
Cause function returns cause value.
func (BuyGoodsRequestValidationError) Error ¶
func (e BuyGoodsRequestValidationError) Error() string
Error satisfies the builtin error interface
func (BuyGoodsRequestValidationError) ErrorName ¶
func (e BuyGoodsRequestValidationError) ErrorName() string
ErrorName returns error name.
func (BuyGoodsRequestValidationError) Field ¶
func (e BuyGoodsRequestValidationError) Field() string
Field function returns field value.
func (BuyGoodsRequestValidationError) Key ¶
func (e BuyGoodsRequestValidationError) Key() bool
Key function returns key value.
func (BuyGoodsRequestValidationError) Reason ¶
func (e BuyGoodsRequestValidationError) Reason() string
Reason function returns reason value.
type GoodsServiceClient ¶ added in v1.0.2
type GoodsServiceClient interface { //购买商品 BuyGoods(ctx context.Context, in *BuyGoodsRequest, opts ...grpc.CallOption) (*base.OperateReply, error) }
GoodsServiceClient is the client API for GoodsService 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 NewGoodsServiceClient ¶ added in v1.0.2
func NewGoodsServiceClient(cc grpc.ClientConnInterface) GoodsServiceClient
type GoodsServiceHTTPClient ¶ added in v1.0.2
type GoodsServiceHTTPClient interface {
BuyGoods(ctx context.Context, req *BuyGoodsRequest, opts ...http.CallOption) (rsp *base.OperateReply, err error)
}
func NewGoodsServiceHTTPClient ¶ added in v1.0.2
func NewGoodsServiceHTTPClient(client *http.Client) GoodsServiceHTTPClient
type GoodsServiceHTTPClientImpl ¶ added in v1.0.2
type GoodsServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*GoodsServiceHTTPClientImpl) BuyGoods ¶ added in v1.0.2
func (c *GoodsServiceHTTPClientImpl) BuyGoods(ctx context.Context, in *BuyGoodsRequest, opts ...http.CallOption) (*base.OperateReply, error)
type GoodsServiceHTTPServer ¶ added in v1.0.2
type GoodsServiceHTTPServer interface {
BuyGoods(context.Context, *BuyGoodsRequest) (*base.OperateReply, error)
}
type GoodsServiceServer ¶ added in v1.0.2
type GoodsServiceServer interface { //购买商品 BuyGoods(context.Context, *BuyGoodsRequest) (*base.OperateReply, error) // contains filtered or unexported methods }
GoodsServiceServer is the server API for GoodsService service. All implementations must embed UnimplementedGoodsServiceServer for forward compatibility
type UnimplementedGoodsServiceServer ¶ added in v1.0.2
type UnimplementedGoodsServiceServer struct { }
UnimplementedGoodsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGoodsServiceServer) BuyGoods ¶ added in v1.0.2
func (UnimplementedGoodsServiceServer) BuyGoods(context.Context, *BuyGoodsRequest) (*base.OperateReply, error)
type UnsafeGoodsServiceServer ¶ added in v1.0.2
type UnsafeGoodsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGoodsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GoodsServiceServer will result in compilation errors.