aggregator

package
v5.4.100 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Aggregator_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aggregator.Aggregator",
	HandlerType: (*AggregatorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FeedSensorPacket",
			Handler:    _Aggregator_FeedSensorPacket_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "aggregator/api.proto",
}

Aggregator_ServiceDesc is the grpc.ServiceDesc for Aggregator 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_aggregator_api_proto protoreflect.FileDescriptor

Functions

func RegisterAggregatorServer

func RegisterAggregatorServer(s grpc.ServiceRegistrar, srv AggregatorServer)

Types

type AggregatorClient

type AggregatorClient interface {
	// Feed packet to processor
	FeedSensorPacket(ctx context.Context, in *SensorPacket, opts ...grpc.CallOption) (*FeedResponse, error)
}

AggregatorClient is the client API for Aggregator 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 NewAggregatorClient

func NewAggregatorClient(cc grpc.ClientConnInterface) AggregatorClient

type AggregatorServer

type AggregatorServer interface {
	// Feed packet to processor
	FeedSensorPacket(context.Context, *SensorPacket) (*FeedResponse, error)
	// contains filtered or unexported methods
}

AggregatorServer is the server API for Aggregator service. All implementations must embed UnimplementedAggregatorServer for forward compatibility

func NewAggregator

func NewAggregator(db *pgxpool.Pool, location *time.Location) (AggregatorServer, error)

NewAggregator instantiates a new aggregator

type FeedResponse

type FeedResponse struct {
	Processed bool `protobuf:"varint,1,opt,name=processed,proto3" json:"processed,omitempty"`
	// contains filtered or unexported fields
}

func (*FeedResponse) Descriptor deprecated

func (*FeedResponse) Descriptor() ([]byte, []int)

Deprecated: Use FeedResponse.ProtoReflect.Descriptor instead.

func (*FeedResponse) GetProcessed

func (x *FeedResponse) GetProcessed() bool

func (*FeedResponse) ProtoMessage

func (*FeedResponse) ProtoMessage()

func (*FeedResponse) ProtoReflect

func (x *FeedResponse) ProtoReflect() protoreflect.Message

func (*FeedResponse) Reset

func (x *FeedResponse) Reset()

func (*FeedResponse) String

func (x *FeedResponse) String() string

type GraphiteSender

type GraphiteSender struct {
	// contains filtered or unexported fields
}

GraphiteSender handles pushing to Graphite

func NewGraphiteSender

func NewGraphiteSender(host string, port int, pathTemplate string) *GraphiteSender

NewGraphiteSender creates a new Graphite sender

func (*GraphiteSender) Push

func (g *GraphiteSender) Push(s sensorStat) bool

Push enqueues a SensorStat to send

func (*GraphiteSender) Run

func (g *GraphiteSender) Run()

Run the mqtt loop

type MqttClient

type MqttClient struct {
	// contains filtered or unexported fields
}

MqttClient handles pushing to Mqtt

func NewMqttClient

func NewMqttClient(mqttHost string, mqttPort int) *MqttClient

NewMqttClient creates a new Mqtt Client

func (*MqttClient) Push

func (cl *MqttClient) Push(s sensorStat) bool

Push enqueues a SensorStat to send

func (*MqttClient) Run

func (cl *MqttClient) Run()

Run the mqtt loop

type SensorPacket

type SensorPacket struct {
	Id   uint32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Seq  uint32  `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"`
	Rssi float32 `protobuf:"fixed32,3,opt,name=rssi,proto3" json:"rssi,omitempty"`
	Lqi  uint32  `protobuf:"varint,4,opt,name=lqi,proto3" json:"lqi,omitempty"`
	Raw  []byte  `protobuf:"bytes,5,opt,name=raw,proto3" json:"raw,omitempty"`
	// contains filtered or unexported fields
}

func (*SensorPacket) Descriptor deprecated

func (*SensorPacket) Descriptor() ([]byte, []int)

Deprecated: Use SensorPacket.ProtoReflect.Descriptor instead.

func (*SensorPacket) GetId

func (x *SensorPacket) GetId() uint32

func (*SensorPacket) GetLqi

func (x *SensorPacket) GetLqi() uint32

func (*SensorPacket) GetRaw

func (x *SensorPacket) GetRaw() []byte

func (*SensorPacket) GetRssi

func (x *SensorPacket) GetRssi() float32

func (*SensorPacket) GetSeq

func (x *SensorPacket) GetSeq() uint32

func (*SensorPacket) ProtoMessage

func (*SensorPacket) ProtoMessage()

func (*SensorPacket) ProtoReflect

func (x *SensorPacket) ProtoReflect() protoreflect.Message

func (*SensorPacket) Reset

func (x *SensorPacket) Reset()

func (*SensorPacket) String

func (x *SensorPacket) String() string

type UnimplementedAggregatorServer

type UnimplementedAggregatorServer struct {
}

UnimplementedAggregatorServer must be embedded to have forward compatible implementations.

func (UnimplementedAggregatorServer) FeedSensorPacket

type UnsafeAggregatorServer

type UnsafeAggregatorServer interface {
	// contains filtered or unexported methods
}

UnsafeAggregatorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AggregatorServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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