publisher

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCClient

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

GRPCClient is a simple gRPC client implementation

func (*GRPCClient) Close

func (c *GRPCClient) Close() error

Close closes the gRPC connection

func (*GRPCClient) SendSensorData

func (c *GRPCClient) SendSensorData(ctx context.Context, data []byte) error

SendSensorData sends a single sensor data point

func (*GRPCClient) SendSensorDataBatch

func (c *GRPCClient) SendSensorDataBatch(ctx context.Context, data [][]byte) error

SendSensorDataBatch sends a batch of sensor data points

type GenericGRPCPublisher

type GenericGRPCPublisher[T any] struct {
	// contains filtered or unexported fields
}

GenericGRPCPublisher is a generic gRPC publisher

func NewGenericGRPCPublisher

func NewGenericGRPCPublisher[T any](address string) (*GenericGRPCPublisher[T], error)

NewGenericGRPCPublisher creates a new generic gRPC publisher

func (*GenericGRPCPublisher[T]) Close

func (g *GenericGRPCPublisher[T]) Close() error

Close closes the gRPC publisher

func (*GenericGRPCPublisher[T]) Publish

func (g *GenericGRPCPublisher[T]) Publish(ctx context.Context, data engine.SensorData[T]) error

Publish publishes a single sensor data point

func (*GenericGRPCPublisher[T]) PublishBatch

func (g *GenericGRPCPublisher[T]) PublishBatch(ctx context.Context, data []engine.SensorData[T]) error

PublishBatch publishes a batch of sensor data points

type GenericHTTPPublisher

type GenericHTTPPublisher[T any] struct {
	// contains filtered or unexported fields
}

GenericHTTPPublisher is a generic HTTP publisher

func NewGenericHTTPPublisher

func NewGenericHTTPPublisher[T any](endpoint string) *GenericHTTPPublisher[T]

NewGenericHTTPPublisher creates a new generic HTTP publisher

func (*GenericHTTPPublisher[T]) Close

func (h *GenericHTTPPublisher[T]) Close() error

Close closes the HTTP publisher

func (*GenericHTTPPublisher[T]) Publish

func (h *GenericHTTPPublisher[T]) Publish(ctx context.Context, data engine.SensorData[T]) error

Publish publishes a single sensor data point

func (*GenericHTTPPublisher[T]) PublishBatch

func (h *GenericHTTPPublisher[T]) PublishBatch(ctx context.Context, data []engine.SensorData[T]) error

PublishBatch publishes a batch of sensor data points

type GenericKafkaPublisher

type GenericKafkaPublisher[T any] struct {
	// contains filtered or unexported fields
}

GenericKafkaPublisher is a generic Kafka publisher

func NewGenericKafkaPublisher

func NewGenericKafkaPublisher[T any](brokers []string, topic string) *GenericKafkaPublisher[T]

NewGenericKafkaPublisher creates a new generic Kafka publisher

func (*GenericKafkaPublisher[T]) Close

func (k *GenericKafkaPublisher[T]) Close() error

Close closes the Kafka publisher

func (*GenericKafkaPublisher[T]) Publish

func (k *GenericKafkaPublisher[T]) Publish(ctx context.Context, data engine.SensorData[T]) error

Publish publishes a single sensor data point

func (*GenericKafkaPublisher[T]) PublishBatch

func (k *GenericKafkaPublisher[T]) PublishBatch(ctx context.Context, data []engine.SensorData[T]) error

PublishBatch publishes a batch of sensor data points

type SensorDataServiceClient

type SensorDataServiceClient interface {
	SendSensorData(ctx context.Context, data []byte) error
	SendSensorDataBatch(ctx context.Context, data [][]byte) error
	Close() error
}

SensorDataService defines the gRPC service interface

Jump to

Keyboard shortcuts

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