Documentation ¶
Index ¶
- Variables
- func RegisterHeadServer(s grpc.ServiceRegistrar, srv HeadServer)
- type GetReply
- type GetRequest
- type HeadClient
- type HeadServer
- type SetReply
- type SetRequest
- func (*SetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetRequest) GetEventTime() *timestamppb.Timestamp
- func (x *SetRequest) GetEventType() SetRequest_EVENT_TYPE
- func (x *SetRequest) GetUserId() uint32
- func (x *SetRequest) GetVideoId() uint32
- func (x *SetRequest) GetVideoTime() uint32
- func (*SetRequest) ProtoMessage()
- func (x *SetRequest) ProtoReflect() protoreflect.Message
- func (x *SetRequest) Reset()
- func (x *SetRequest) String() string
- type SetRequest_EVENT_TYPE
- func (SetRequest_EVENT_TYPE) Descriptor() protoreflect.EnumDescriptor
- func (x SetRequest_EVENT_TYPE) Enum() *SetRequest_EVENT_TYPE
- func (SetRequest_EVENT_TYPE) EnumDescriptor() ([]byte, []int)deprecated
- func (x SetRequest_EVENT_TYPE) Number() protoreflect.EnumNumber
- func (x SetRequest_EVENT_TYPE) String() string
- func (SetRequest_EVENT_TYPE) Type() protoreflect.EnumType
- type UnimplementedHeadServer
- type UnsafeHeadServer
Constants ¶
This section is empty.
Variables ¶
var ( SetRequest_EVENT_TYPE_name = map[int32]string{ 0: "watch", 1: "scroll", } SetRequest_EVENT_TYPE_value = map[string]int32{ "watch": 0, "scroll": 1, } )
Enum value maps for SetRequest_EVENT_TYPE.
var File_api_api_proto protoreflect.FileDescriptor
var Head_ServiceDesc = grpc.ServiceDesc{ ServiceName: "head.head", HandlerType: (*HeadServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Set", Handler: _Head_Set_Handler, }, { MethodName: "Get", Handler: _Head_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/api.proto", }
Head_ServiceDesc is the grpc.ServiceDesc for Head service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHeadServer ¶
func RegisterHeadServer(s grpc.ServiceRegistrar, srv HeadServer)
Types ¶
type GetReply ¶
type GetReply struct { VideoTime uint32 `protobuf:"varint,1,opt,name=video_time,json=videoTime,proto3" json:"video_time,omitempty"` // contains filtered or unexported fields }
func (*GetReply) Descriptor
deprecated
func (*GetReply) GetVideoTime ¶
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct { UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` VideoId uint32 `protobuf:"varint,2,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetUserId ¶
func (x *GetRequest) GetUserId() uint32
func (*GetRequest) GetVideoId ¶
func (x *GetRequest) GetVideoId() uint32
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type HeadClient ¶
type HeadClient interface { Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetReply, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error) }
HeadClient is the client API for Head 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 NewHeadClient ¶
func NewHeadClient(cc grpc.ClientConnInterface) HeadClient
type HeadServer ¶
type HeadServer interface { Set(context.Context, *SetRequest) (*SetReply, error) Get(context.Context, *GetRequest) (*GetReply, error) // contains filtered or unexported methods }
HeadServer is the server API for Head service. All implementations must embed UnimplementedHeadServer for forward compatibility
type SetReply ¶
type SetReply struct {
// contains filtered or unexported fields
}
func (*SetReply) Descriptor
deprecated
func (*SetReply) ProtoMessage ¶
func (*SetReply) ProtoMessage()
func (*SetReply) ProtoReflect ¶
func (x *SetReply) ProtoReflect() protoreflect.Message
type SetRequest ¶
type SetRequest struct { UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` EventTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=event_time,json=eventTime,proto3" json:"event_time,omitempty"` EventType SetRequest_EVENT_TYPE `protobuf:"varint,3,opt,name=event_type,json=eventType,proto3,enum=head.SetRequest_EVENT_TYPE" json:"event_type,omitempty"` VideoId uint32 `protobuf:"varint,4,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"` VideoTime uint32 `protobuf:"varint,5,opt,name=video_time,json=videoTime,proto3" json:"video_time,omitempty"` // in seconds // contains filtered or unexported fields }
func (*SetRequest) Descriptor
deprecated
func (*SetRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetRequest.ProtoReflect.Descriptor instead.
func (*SetRequest) GetEventTime ¶
func (x *SetRequest) GetEventTime() *timestamppb.Timestamp
func (*SetRequest) GetEventType ¶
func (x *SetRequest) GetEventType() SetRequest_EVENT_TYPE
func (*SetRequest) GetUserId ¶
func (x *SetRequest) GetUserId() uint32
func (*SetRequest) GetVideoId ¶
func (x *SetRequest) GetVideoId() uint32
func (*SetRequest) GetVideoTime ¶
func (x *SetRequest) GetVideoTime() uint32
func (*SetRequest) ProtoMessage ¶
func (*SetRequest) ProtoMessage()
func (*SetRequest) ProtoReflect ¶
func (x *SetRequest) ProtoReflect() protoreflect.Message
func (*SetRequest) Reset ¶
func (x *SetRequest) Reset()
func (*SetRequest) String ¶
func (x *SetRequest) String() string
type SetRequest_EVENT_TYPE ¶
type SetRequest_EVENT_TYPE int32
const ( SetRequest_watch SetRequest_EVENT_TYPE = 0 SetRequest_scroll SetRequest_EVENT_TYPE = 1 )
func (SetRequest_EVENT_TYPE) Descriptor ¶
func (SetRequest_EVENT_TYPE) Descriptor() protoreflect.EnumDescriptor
func (SetRequest_EVENT_TYPE) Enum ¶
func (x SetRequest_EVENT_TYPE) Enum() *SetRequest_EVENT_TYPE
func (SetRequest_EVENT_TYPE) EnumDescriptor
deprecated
func (SetRequest_EVENT_TYPE) EnumDescriptor() ([]byte, []int)
Deprecated: Use SetRequest_EVENT_TYPE.Descriptor instead.
func (SetRequest_EVENT_TYPE) Number ¶
func (x SetRequest_EVENT_TYPE) Number() protoreflect.EnumNumber
func (SetRequest_EVENT_TYPE) String ¶
func (x SetRequest_EVENT_TYPE) String() string
func (SetRequest_EVENT_TYPE) Type ¶
func (SetRequest_EVENT_TYPE) Type() protoreflect.EnumType
type UnimplementedHeadServer ¶
type UnimplementedHeadServer struct { }
UnimplementedHeadServer must be embedded to have forward compatible implementations.
func (UnimplementedHeadServer) Get ¶
func (UnimplementedHeadServer) Get(context.Context, *GetRequest) (*GetReply, error)
func (UnimplementedHeadServer) Set ¶
func (UnimplementedHeadServer) Set(context.Context, *SetRequest) (*SetReply, error)
type UnsafeHeadServer ¶
type UnsafeHeadServer interface {
// contains filtered or unexported methods
}
UnsafeHeadServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HeadServer will result in compilation errors.