mackerelremo

package module
v0.0.0-...-2b3c38e Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 5 Imported by: 0

README

mackerel-remo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchResult

type FetchResult struct {
	Timestamp   time.Time
	Temperature *FetchResultRow
	Humidity    *FetchResultRow
}

type FetchResultRow

type FetchResultRow struct {
	Value float64
	Delay time.Duration
}

type Fetcher

type Fetcher struct {
	*FetcherConfig
	// contains filtered or unexported fields
}

func NewFetcher

func NewFetcher(cfg *FetcherConfig) *Fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context) (*FetchResult, error)

type FetcherConfig

type FetcherConfig struct {
	NatureAccessToken string
	RemoDeviceID      string
}

type MackerelExporter

type MackerelExporter struct {
	*MackerelExporterConfig
	// contains filtered or unexported fields
}

func NewMackerelExporter

func NewMackerelExporter(cfg *MackerelExporterConfig) *MackerelExporter

func (*MackerelExporter) Export

func (e *MackerelExporter) Export(ctx context.Context, result *FetchResult) error

type MackerelExporterConfig

type MackerelExporterConfig struct {
	MackerelApiKey          string
	MackerelServiceName     string
	RemoDeviceNameForExport string
}

type Runner

type Runner struct {
	*RunnerConfig
}

func NewRunner

func NewRunner(cfg *RunnerConfig) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

type RunnerConfig

type RunnerConfig struct {
	MackerelAPIKey          string `env:"MACKEREL_API_KEY"`
	MackerelServiceName     string `env:"MACKEREL_SERVICE_NAME"`
	NatureAccessToken       string `env:"NATURE_ACCESS_TOKEN"`
	RemoDeviceID            string `env:"REMO_DEVICE_ID"`
	RemoDeviceNameForExport string `env:"REMO_DEVICE_NAME_FOR_EXPORT"`
}

Directories

Path Synopsis
cmd
mackerel-remo command

Jump to

Keyboard shortcuts

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