Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterActivityHTTPServer(s *http.Server, srv ActivityHTTPServer)
- func RegisterActivityServer(s grpc.ServiceRegistrar, srv ActivityServer)
- type ActivityClient
- type ActivityHTTPClient
- type ActivityHTTPClientImpl
- type ActivityHTTPServer
- type ActivityServer
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type GetSkuReply
- type GetSkuReply_StuBase
- func (*GetSkuReply_StuBase) Descriptor() ([]byte, []int)deprecated
- func (x *GetSkuReply_StuBase) GetAge() int32
- func (x *GetSkuReply_StuBase) GetId() uint64
- func (x *GetSkuReply_StuBase) GetName() string
- func (x *GetSkuReply_StuBase) GetScore() float32
- func (*GetSkuReply_StuBase) ProtoMessage()
- func (x *GetSkuReply_StuBase) ProtoReflect() protoreflect.Message
- func (x *GetSkuReply_StuBase) Reset()
- func (x *GetSkuReply_StuBase) String() string
- type GetSkuRequest
- func (*GetSkuRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSkuRequest) GetPageNum() int32
- func (x *GetSkuRequest) GetPageSize() int32
- func (*GetSkuRequest) ProtoMessage()
- func (x *GetSkuRequest) ProtoReflect() protoreflect.Message
- func (x *GetSkuRequest) Reset()
- func (x *GetSkuRequest) String() string
- type UnimplementedActivityServer
- type UnsafeActivityServer
Constants ¶
const OperationActivityGetSku = "/activity.v1.Activity/GetSku"
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "ACTIVITY_UNSPECIFIED", 1: "USER_NOT_FOUND", } ErrorReason_value = map[string]int32{ "ACTIVITY_UNSPECIFIED": 0, "USER_NOT_FOUND": 1, } )
Enum value maps for ErrorReason.
var Activity_ServiceDesc = grpc.ServiceDesc{ ServiceName: "activity.v1.Activity", HandlerType: (*ActivityServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetSku", Handler: _Activity_GetSku_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/activity/v1/activity.proto", }
Activity_ServiceDesc is the grpc.ServiceDesc for Activity service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_activity_v1_activity_proto protoreflect.FileDescriptor
var File_api_activity_v1_error_reason_proto protoreflect.FileDescriptor
Functions ¶
func RegisterActivityHTTPServer ¶
func RegisterActivityHTTPServer(s *http.Server, srv ActivityHTTPServer)
func RegisterActivityServer ¶
func RegisterActivityServer(s grpc.ServiceRegistrar, srv ActivityServer)
Types ¶
type ActivityClient ¶
type ActivityClient interface { // Sends a greeting GetSku(ctx context.Context, in *GetSkuRequest, opts ...grpc.CallOption) (*GetSkuReply, error) }
ActivityClient is the client API for Activity 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 NewActivityClient ¶
func NewActivityClient(cc grpc.ClientConnInterface) ActivityClient
type ActivityHTTPClient ¶
type ActivityHTTPClient interface {
GetSku(ctx context.Context, req *GetSkuRequest, opts ...http.CallOption) (rsp *GetSkuReply, err error)
}
func NewActivityHTTPClient ¶
func NewActivityHTTPClient(client *http.Client) ActivityHTTPClient
type ActivityHTTPClientImpl ¶
type ActivityHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*ActivityHTTPClientImpl) GetSku ¶
func (c *ActivityHTTPClientImpl) GetSku(ctx context.Context, in *GetSkuRequest, opts ...http.CallOption) (*GetSkuReply, error)
type ActivityHTTPServer ¶
type ActivityHTTPServer interface {
GetSku(context.Context, *GetSkuRequest) (*GetSkuReply, error)
}
type ActivityServer ¶
type ActivityServer interface { // Sends a greeting GetSku(context.Context, *GetSkuRequest) (*GetSkuReply, error) // contains filtered or unexported methods }
ActivityServer is the server API for Activity service. All implementations must embed UnimplementedActivityServer for forward compatibility
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_ACTIVITY_UNSPECIFIED ErrorReason = 0 ErrorReason_USER_NOT_FOUND ErrorReason = 1 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type GetSkuReply ¶
type GetSkuReply struct { StudentList []*GetSkuReply_StuBase `protobuf:"bytes,1,rep,name=studentList,proto3" json:"studentList,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*GetSkuReply) Descriptor
deprecated
func (*GetSkuReply) Descriptor() ([]byte, []int)
Deprecated: Use GetSkuReply.ProtoReflect.Descriptor instead.
func (*GetSkuReply) GetStudentList ¶
func (x *GetSkuReply) GetStudentList() []*GetSkuReply_StuBase
func (*GetSkuReply) ProtoMessage ¶
func (*GetSkuReply) ProtoMessage()
func (*GetSkuReply) ProtoReflect ¶
func (x *GetSkuReply) ProtoReflect() protoreflect.Message
func (*GetSkuReply) Reset ¶
func (x *GetSkuReply) Reset()
func (*GetSkuReply) String ¶
func (x *GetSkuReply) String() string
type GetSkuReply_StuBase ¶
type GetSkuReply_StuBase struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` Score float32 `protobuf:"fixed32,4,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*GetSkuReply_StuBase) Descriptor
deprecated
func (*GetSkuReply_StuBase) Descriptor() ([]byte, []int)
Deprecated: Use GetSkuReply_StuBase.ProtoReflect.Descriptor instead.
func (*GetSkuReply_StuBase) GetAge ¶
func (x *GetSkuReply_StuBase) GetAge() int32
func (*GetSkuReply_StuBase) GetId ¶
func (x *GetSkuReply_StuBase) GetId() uint64
func (*GetSkuReply_StuBase) GetName ¶
func (x *GetSkuReply_StuBase) GetName() string
func (*GetSkuReply_StuBase) GetScore ¶
func (x *GetSkuReply_StuBase) GetScore() float32
func (*GetSkuReply_StuBase) ProtoMessage ¶
func (*GetSkuReply_StuBase) ProtoMessage()
func (*GetSkuReply_StuBase) ProtoReflect ¶
func (x *GetSkuReply_StuBase) ProtoReflect() protoreflect.Message
func (*GetSkuReply_StuBase) Reset ¶
func (x *GetSkuReply_StuBase) Reset()
func (*GetSkuReply_StuBase) String ¶
func (x *GetSkuReply_StuBase) String() string
type GetSkuRequest ¶
type GetSkuRequest struct { PageNum int32 `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` // contains filtered or unexported fields }
The request message containing the user's name.
func (*GetSkuRequest) Descriptor
deprecated
func (*GetSkuRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSkuRequest.ProtoReflect.Descriptor instead.
func (*GetSkuRequest) GetPageNum ¶
func (x *GetSkuRequest) GetPageNum() int32
func (*GetSkuRequest) GetPageSize ¶
func (x *GetSkuRequest) GetPageSize() int32
func (*GetSkuRequest) ProtoMessage ¶
func (*GetSkuRequest) ProtoMessage()
func (*GetSkuRequest) ProtoReflect ¶
func (x *GetSkuRequest) ProtoReflect() protoreflect.Message
func (*GetSkuRequest) Reset ¶
func (x *GetSkuRequest) Reset()
func (*GetSkuRequest) String ¶
func (x *GetSkuRequest) String() string
type UnimplementedActivityServer ¶
type UnimplementedActivityServer struct { }
UnimplementedActivityServer must be embedded to have forward compatible implementations.
func (UnimplementedActivityServer) GetSku ¶
func (UnimplementedActivityServer) GetSku(context.Context, *GetSkuRequest) (*GetSkuReply, error)
type UnsafeActivityServer ¶
type UnsafeActivityServer interface {
// contains filtered or unexported methods
}
UnsafeActivityServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ActivityServer will result in compilation errors.