collector

package
v0.4.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Collector_ReportNow_FullMethodName         = "/api.collector.Collector/ReportNow"
	Collector_SetReportInterval_FullMethodName = "/api.collector.Collector/SetReportInterval"
	Collector_BoatControl_FullMethodName       = "/api.collector.Collector/BoatControl"
)
View Source
const OperationCollectorBoatControl = "/api.collector.Collector/BoatControl"
View Source
const OperationCollectorReportNow = "/api.collector.Collector/ReportNow"
View Source
const OperationCollectorSetReportInterval = "/api.collector.Collector/SetReportInterval"

Variables

View Source
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.

View Source
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)

View Source
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) Enum added in v0.4.6

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 (BoatControlCommand) String added in v0.4.6

func (x BoatControlCommand) String() string

func (BoatControlCommand) Type added in v0.4.6

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

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

func (*Empty) Reset added in v0.2.3

func (x *Empty) Reset()

func (*Empty) String added in v0.2.3

func (x *Empty) String() string

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) ReportNow added in v0.4.6

func (UnimplementedCollectorServer) SetReportInterval

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL