scraper

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter added in v0.11.0

type Exporter struct {
	Poller  Publisher[solaredge.Update]
	Metrics *Metrics
	Logger  *slog.Logger
}

func (Exporter) Run added in v0.11.0

func (e Exporter) Run(ctx context.Context) error

type Metrics added in v0.11.0

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

func NewMetrics added in v0.11.0

func NewMetrics() *Metrics

func (Metrics) Collect added in v0.11.0

func (m Metrics) Collect(ch chan<- prometheus.Metric)

func (Metrics) Describe added in v0.11.0

func (m Metrics) Describe(ch chan<- *prometheus.Desc)

type Poller

type Poller struct {
	Client   SolarEdgeGetter
	Interval time.Duration
	Logger   *slog.Logger
	pubsub.Publisher[solaredge.Update]
}

func (*Poller) Run added in v0.11.0

func (p *Poller) Run(ctx context.Context) error

type Publisher

type Publisher[T any] interface {
	Subscribe() chan T
	Unsubscribe(chan T)
}

type SolarEdgeGetter added in v0.11.0

type SolarEdgeGetter interface {
	GetUpdate(context.Context) (solaredge.Update, error)
}

type Store added in v0.11.0

type Store interface {
	Store(repository.Measurement) error
}

type TadoGetter added in v0.11.0

type TadoGetter interface {
	GetWeatherInfo(context.Context) (tado.WeatherInfo, error)
}

type Writer added in v0.11.0

type Writer struct {
	Store
	TadoGetter
	Poller   Publisher[solaredge.Update]
	Interval time.Duration
	Logger   *slog.Logger
	// contains filtered or unexported fields
}

func (*Writer) Run added in v0.11.0

func (w *Writer) Run(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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