targets

package module
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 20 Imported by: 3

README

Go Reference GitHub go.mod Go version Go Report Card

Indoor Climate Data Targets

This package contains different targets indoor climate data can be send to. You can assign such a target to the SensorDataCollector using it's AppendTarget method-

Stdout Publisher

Writes indoor climate data to stout using fmt.

Log Publisher

Target, which writes indoor climate data to given logger with log level Info. See Log for more details about used logger.

AWS SQS Publisher

This target will send indoor climate measurements to a AWS SQS queue if one has been defined in config as followed.

hdb:
  queue: sqs-queue

See Metrics for ore details about timesteam integration.

AWS Timestream Publisher

To collect indoor climate data in a timestream database (AWS Timestream) you can provide a timestream config and a correcponding publisher will be added.

aws:
  timestream:
    region: eu-west-1
    database: timestreamdb
    table: timestreamtable
    batch_size: 10

Note: In addition to this config you've to provide AWS access keys with correct permissions.

Documentation

Overview

Package contains provides diferent targets Indoor Climate date can be send to.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogTarget

func NewLogTarget(logger log.Logger) indoorclimate.Publisher

NewLogTarget create a new log publisher.

func NewS3Target added in v1.0.12

func NewS3Target(conf config.Config) (indoorclimate.Publisher, error)

NewS3Target create a new S3 uploader.

func NewSnsTarget added in v1.0.8

func NewSnsTarget(conf config.Config) indoorclimate.Publisher

NewSnsTarget creates a new publisher for AWS SNS.

func NewSqsTarget

func NewSqsTarget(conf config.Config, logger log.Logger) indoorclimate.Publisher

NewSqsTarget creates a new publisher for AWS SQS.

func NewStdoutTarget added in v1.0.1

func NewStdoutTarget() indoorclimate.Publisher

NewStdoutTarget create a new publisher writing to stdout using fmt.

func NewTimestreamTarget added in v1.0.2

func NewTimestreamTarget(conf config.Config, logger log.Logger) indoorclimate.Publisher

NewTimestreamTarget returns a new target which writes measurements to AWS Timestream.

Types

type LogTarget

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

LogTarget writes given indoor climate data to an internal logger

func (*LogTarget) SendMeasurement

func (logPublisher *LogTarget) SendMeasurement(measurement indoorclimate.IndoorClimateMeasurement) error

SendMeasurement will write log message with level Info for passed indoor climate measurement.

type S3Target added in v1.0.12

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

S3Target uploads passed indoor climate measurement to a AWS S3 bucket.

func (*S3Target) SendMeasurement added in v1.0.12

func (target *S3Target) SendMeasurement(measurement indoorclimate.IndoorClimateMeasurement) error

SendMeasurement will start to transfer passed measurement to a target.

type SnsTarget added in v1.0.8

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

SnsTarget sends passed indoor climate data to a AWS SNS topic.

func (*SnsTarget) SendMeasurement added in v1.0.8

func (target *SnsTarget) SendMeasurement(measurement indoorclimate.IndoorClimateMeasurement) error

SendMeasurement will start to transfer passed measurement to a target.

type SqsTarget

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

SqsTarget sends passed indoor climate data to a AWS SQS queue.

func (*SqsTarget) SendMeasurement

func (target *SqsTarget) SendMeasurement(measurement indoorclimate.IndoorClimateMeasurement) error

SendMeasurement will start to transfer passed measurement to a target.

type StdoutTarget

type StdoutTarget struct {
}

StdoutTarget writes given indoor climate data to Stdout unsing fmt package.

func (*StdoutTarget) SendMeasurement added in v1.0.1

func (logPublisher *StdoutTarget) SendMeasurement(measurement indoorclimate.IndoorClimateMeasurement) error

SendMeasurement will write passed indoor climate data to stdout.

type TimestreamTarget

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

TimestreamTarget writes writes publishing metrics to AWS Timestream.

func (*TimestreamTarget) SendMeasurement

func (target *TimestreamTarget) SendMeasurement(measurement indoorclimate.IndoorClimateMeasurement) error

Send given indoor climate data to AWS Timestream.

Jump to

Keyboard shortcuts

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