Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCollectorHTTPServer(s *http.Server, srv CollectorHTTPServer)
- func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer)
- type BoatControlCommand
- func (BoatControlCommand) Descriptor() protoreflect.EnumDescriptor
- func (x BoatControlCommand) Enum() *BoatControlCommand
- func (BoatControlCommand) EnumDescriptor() ([]byte, []int)deprecated
- func (x BoatControlCommand) Number() protoreflect.EnumNumber
- func (x BoatControlCommand) String() string
- func (BoatControlCommand) Type() protoreflect.EnumType
- type BoatControlReq
- func (*BoatControlReq) Descriptor() ([]byte, []int)deprecated
- func (x *BoatControlReq) GetCommand() BoatControlCommand
- func (x *BoatControlReq) GetDeviceId() uint64
- func (*BoatControlReq) ProtoMessage()
- func (x *BoatControlReq) ProtoReflect() protoreflect.Message
- func (x *BoatControlReq) Reset()
- func (x *BoatControlReq) String() string
- type CollectorClient
- type CollectorHTTPClient
- type CollectorHTTPClientImpl
- func (c *CollectorHTTPClientImpl) BoatControl(ctx context.Context, in *BoatControlReq, opts ...http.CallOption) (*Empty, error)
- func (c *CollectorHTTPClientImpl) ReportNow(ctx context.Context, in *ReportNowReq, opts ...http.CallOption) (*Empty, error)
- func (c *CollectorHTTPClientImpl) SetReportInterval(ctx context.Context, in *SetReportIntervalReq, opts ...http.CallOption) (*SetReportIntervalResp, error)
- type CollectorHTTPServer
- type CollectorServer
- type Empty
- type ReportNowReq
- type SetReportIntervalReq
- func (*SetReportIntervalReq) Descriptor() ([]byte, []int)deprecated
- func (x *SetReportIntervalReq) GetDeviceId() uint64
- func (x *SetReportIntervalReq) GetInterval() uint64
- func (*SetReportIntervalReq) ProtoMessage()
- func (x *SetReportIntervalReq) ProtoReflect() protoreflect.Message
- func (x *SetReportIntervalReq) Reset()
- func (x *SetReportIntervalReq) String() string
- type SetReportIntervalResp
- type UnimplementedCollectorServer
- func (UnimplementedCollectorServer) BoatControl(context.Context, *BoatControlReq) (*Empty, error)
- func (UnimplementedCollectorServer) ReportNow(context.Context, *ReportNowReq) (*Empty, error)
- func (UnimplementedCollectorServer) SetReportInterval(context.Context, *SetReportIntervalReq) (*SetReportIntervalResp, error)
- type UnsafeCollectorServer
Constants ¶
const ( Collector_ReportNow_FullMethodName = "/api.collector.Collector/ReportNow" Collector_SetReportInterval_FullMethodName = "/api.collector.Collector/SetReportInterval" Collector_BoatControl_FullMethodName = "/api.collector.Collector/BoatControl" )
const OperationCollectorBoatControl = "/api.collector.Collector/BoatControl"
const OperationCollectorReportNow = "/api.collector.Collector/ReportNow"
const OperationCollectorSetReportInterval = "/api.collector.Collector/SetReportInterval"
Variables ¶
var ( BoatControlCommand_name = map[int32]string{ 0: "FORWARD", 1: "LEFT", 2: "RIGHT", } BoatControlCommand_value = map[string]int32{ "FORWARD": 0, "LEFT": 1, "RIGHT": 2, } )
Enum value maps for BoatControlCommand.
var Collector_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.collector.Collector", HandlerType: (*CollectorServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ReportNow", Handler: _Collector_ReportNow_Handler, }, { MethodName: "SetReportInterval", Handler: _Collector_SetReportInterval_Handler, }, { MethodName: "BoatControl", Handler: _Collector_BoatControl_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "collector/collector.proto", }
Collector_ServiceDesc is the grpc.ServiceDesc for Collector service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_collector_collector_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCollectorHTTPServer ¶
func RegisterCollectorHTTPServer(s *http.Server, srv CollectorHTTPServer)
func RegisterCollectorServer ¶
func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer)
Types ¶
type BoatControlCommand ¶ added in v0.4.6
type BoatControlCommand int32
const ( BoatControlCommand_FORWARD BoatControlCommand = 0 BoatControlCommand_LEFT BoatControlCommand = 1 BoatControlCommand_RIGHT BoatControlCommand = 2 )
func (BoatControlCommand) Descriptor ¶ added in v0.4.6
func (BoatControlCommand) Descriptor() protoreflect.EnumDescriptor
func (BoatControlCommand) Enum ¶ added in v0.4.6
func (x BoatControlCommand) Enum() *BoatControlCommand
func (BoatControlCommand) EnumDescriptor
deprecated
added in
v0.4.6
func (BoatControlCommand) EnumDescriptor() ([]byte, []int)
Deprecated: Use BoatControlCommand.Descriptor instead.
func (BoatControlCommand) Number ¶ added in v0.4.6
func (x BoatControlCommand) Number() protoreflect.EnumNumber
func (BoatControlCommand) String ¶ added in v0.4.6
func (x BoatControlCommand) String() string
func (BoatControlCommand) Type ¶ added in v0.4.6
func (BoatControlCommand) Type() protoreflect.EnumType
type BoatControlReq ¶ added in v0.4.6
type BoatControlReq struct { DeviceId uint64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"deviceId" form:"deviceId" binding:"required"` // @gotags: form:"deviceId" json:"deviceId" binding:"required" Command BoatControlCommand `protobuf:"varint,2,opt,name=command,proto3,enum=api.collector.BoatControlCommand" json:"command,omitempty"` // contains filtered or unexported fields }
func (*BoatControlReq) Descriptor
deprecated
added in
v0.4.6
func (*BoatControlReq) Descriptor() ([]byte, []int)
Deprecated: Use BoatControlReq.ProtoReflect.Descriptor instead.
func (*BoatControlReq) GetCommand ¶ added in v0.4.6
func (x *BoatControlReq) GetCommand() BoatControlCommand
func (*BoatControlReq) GetDeviceId ¶ added in v0.4.6
func (x *BoatControlReq) GetDeviceId() uint64
func (*BoatControlReq) ProtoMessage ¶ added in v0.4.6
func (*BoatControlReq) ProtoMessage()
func (*BoatControlReq) ProtoReflect ¶ added in v0.4.6
func (x *BoatControlReq) ProtoReflect() protoreflect.Message
func (*BoatControlReq) Reset ¶ added in v0.4.6
func (x *BoatControlReq) Reset()
func (*BoatControlReq) String ¶ added in v0.4.6
func (x *BoatControlReq) String() string
type CollectorClient ¶
type CollectorClient interface { ReportNow(ctx context.Context, in *ReportNowReq, opts ...grpc.CallOption) (*Empty, error) SetReportInterval(ctx context.Context, in *SetReportIntervalReq, opts ...grpc.CallOption) (*SetReportIntervalResp, error) BoatControl(ctx context.Context, in *BoatControlReq, opts ...grpc.CallOption) (*Empty, error) }
CollectorClient is the client API for Collector 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 NewCollectorClient ¶
func NewCollectorClient(cc grpc.ClientConnInterface) CollectorClient
type CollectorHTTPClient ¶
type CollectorHTTPClient interface { BoatControl(ctx context.Context, req *BoatControlReq, opts ...http.CallOption) (rsp *Empty, err error) ReportNow(ctx context.Context, req *ReportNowReq, opts ...http.CallOption) (rsp *Empty, err error) SetReportInterval(ctx context.Context, req *SetReportIntervalReq, opts ...http.CallOption) (rsp *SetReportIntervalResp, err error) }
func NewCollectorHTTPClient ¶
func NewCollectorHTTPClient(client *http.Client) CollectorHTTPClient
type CollectorHTTPClientImpl ¶
type CollectorHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*CollectorHTTPClientImpl) BoatControl ¶ added in v0.4.6
func (c *CollectorHTTPClientImpl) BoatControl(ctx context.Context, in *BoatControlReq, opts ...http.CallOption) (*Empty, error)
func (*CollectorHTTPClientImpl) ReportNow ¶ added in v0.4.6
func (c *CollectorHTTPClientImpl) ReportNow(ctx context.Context, in *ReportNowReq, opts ...http.CallOption) (*Empty, error)
func (*CollectorHTTPClientImpl) SetReportInterval ¶
func (c *CollectorHTTPClientImpl) SetReportInterval(ctx context.Context, in *SetReportIntervalReq, opts ...http.CallOption) (*SetReportIntervalResp, error)
type CollectorHTTPServer ¶
type CollectorHTTPServer interface { BoatControl(context.Context, *BoatControlReq) (*Empty, error) ReportNow(context.Context, *ReportNowReq) (*Empty, error) SetReportInterval(context.Context, *SetReportIntervalReq) (*SetReportIntervalResp, error) }
type CollectorServer ¶
type CollectorServer interface { ReportNow(context.Context, *ReportNowReq) (*Empty, error) SetReportInterval(context.Context, *SetReportIntervalReq) (*SetReportIntervalResp, error) BoatControl(context.Context, *BoatControlReq) (*Empty, error) // contains filtered or unexported methods }
CollectorServer is the server API for Collector service. All implementations must embed UnimplementedCollectorServer for forward compatibility.
type Empty ¶ added in v0.2.3
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
added in
v0.2.3
func (*Empty) ProtoMessage ¶ added in v0.2.3
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶ added in v0.2.3
func (x *Empty) ProtoReflect() protoreflect.Message
type ReportNowReq ¶ added in v0.4.6
type ReportNowReq struct { DeviceId uint64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"deviceId" form:"deviceId" binding:"required"` // @gotags: form:"deviceId" json:"deviceId" binding:"required" // contains filtered or unexported fields }
func (*ReportNowReq) Descriptor
deprecated
added in
v0.4.6
func (*ReportNowReq) Descriptor() ([]byte, []int)
Deprecated: Use ReportNowReq.ProtoReflect.Descriptor instead.
func (*ReportNowReq) GetDeviceId ¶ added in v0.4.6
func (x *ReportNowReq) GetDeviceId() uint64
func (*ReportNowReq) ProtoMessage ¶ added in v0.4.6
func (*ReportNowReq) ProtoMessage()
func (*ReportNowReq) ProtoReflect ¶ added in v0.4.6
func (x *ReportNowReq) ProtoReflect() protoreflect.Message
func (*ReportNowReq) Reset ¶ added in v0.4.6
func (x *ReportNowReq) Reset()
func (*ReportNowReq) String ¶ added in v0.4.6
func (x *ReportNowReq) String() string
type SetReportIntervalReq ¶
type SetReportIntervalReq struct { DeviceId uint64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"deviceId" form:"deviceId" binding:"required"` // @gotags: form:"deviceId" json:"deviceId" binding:"required" Interval uint64 `protobuf:"varint,2,opt,name=interval,proto3" json:"interval,omitempty"` // contains filtered or unexported fields }
func (*SetReportIntervalReq) Descriptor
deprecated
func (*SetReportIntervalReq) Descriptor() ([]byte, []int)
Deprecated: Use SetReportIntervalReq.ProtoReflect.Descriptor instead.
func (*SetReportIntervalReq) GetDeviceId ¶ added in v0.4.6
func (x *SetReportIntervalReq) GetDeviceId() uint64
func (*SetReportIntervalReq) GetInterval ¶
func (x *SetReportIntervalReq) GetInterval() uint64
func (*SetReportIntervalReq) ProtoMessage ¶
func (*SetReportIntervalReq) ProtoMessage()
func (*SetReportIntervalReq) ProtoReflect ¶
func (x *SetReportIntervalReq) ProtoReflect() protoreflect.Message
func (*SetReportIntervalReq) Reset ¶
func (x *SetReportIntervalReq) Reset()
func (*SetReportIntervalReq) String ¶
func (x *SetReportIntervalReq) String() string
type SetReportIntervalResp ¶
type SetReportIntervalResp struct {
// contains filtered or unexported fields
}
func (*SetReportIntervalResp) Descriptor
deprecated
func (*SetReportIntervalResp) Descriptor() ([]byte, []int)
Deprecated: Use SetReportIntervalResp.ProtoReflect.Descriptor instead.
func (*SetReportIntervalResp) ProtoMessage ¶
func (*SetReportIntervalResp) ProtoMessage()
func (*SetReportIntervalResp) ProtoReflect ¶
func (x *SetReportIntervalResp) ProtoReflect() protoreflect.Message
func (*SetReportIntervalResp) Reset ¶
func (x *SetReportIntervalResp) Reset()
func (*SetReportIntervalResp) String ¶
func (x *SetReportIntervalResp) String() string
type UnimplementedCollectorServer ¶
type UnimplementedCollectorServer struct{}
UnimplementedCollectorServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedCollectorServer) BoatControl ¶ added in v0.4.6
func (UnimplementedCollectorServer) BoatControl(context.Context, *BoatControlReq) (*Empty, error)
func (UnimplementedCollectorServer) ReportNow ¶ added in v0.4.6
func (UnimplementedCollectorServer) ReportNow(context.Context, *ReportNowReq) (*Empty, error)
func (UnimplementedCollectorServer) SetReportInterval ¶
func (UnimplementedCollectorServer) SetReportInterval(context.Context, *SetReportIntervalReq) (*SetReportIntervalResp, error)
type UnsafeCollectorServer ¶
type UnsafeCollectorServer interface {
// contains filtered or unexported methods
}
UnsafeCollectorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CollectorServer will result in compilation errors.