Compare commits

...

23 Commits

Author SHA1 Message Date
133c6f7315 map weather update
All checks were successful
Build and Publish / release (push) Successful in 4m12s
Build and Publish / helm-release (push) Successful in 22s
2025-03-20 16:04:28 -04:00
220cc818e7 continue working on weather mapping 2025-03-15 09:53:13 -04:00
69fd27916b implement grpc weather 2025-03-14 23:10:01 -04:00
421c246cc6 remove flux from ale 2025-03-10 16:11:12 -04:00
6f297829fc add flux to ale 2025-03-10 16:08:30 -04:00
797b0a2f3a update TODO 2025-03-08 17:40:03 -05:00
be66762834 add helm ci 2025-03-08 17:30:56 -05:00
7e53afe035 add helm ci
All checks were successful
Build and Publish / helm-release (push) Successful in 37s
Build and Publish / release (push) Successful in 3m7s
2025-03-08 17:29:40 -05:00
be2895695f add helm ci
All checks were successful
Build and Publish / helm-release (push) Successful in 41s
Build and Publish / release (push) Successful in 2m43s
2025-03-08 17:22:19 -05:00
27af90322a add helm ci
Some checks failed
Build and Publish / helm-release (push) Failing after 1m5s
Build and Publish / release (push) Successful in 3m16s
2025-03-08 17:16:35 -05:00
a8e7b24656 add health checks 2025-03-08 16:53:15 -05:00
2653825ac8 implement hull helm chart 2025-03-08 16:35:08 -05:00
a99e52ae4c implement hull helm chart 2025-03-08 16:08:41 -05:00
48828bf8d0 implement hull helm chart 2025-03-08 12:33:45 -05:00
bcf4c0b5ce start helm chart 2025-03-07 20:35:23 -05:00
8674bb4e01 implement grpc weather
All checks were successful
Build and Publish / release (push) Successful in 4m42s
2025-03-07 17:24:05 -05:00
74120183ab add grpc support 2025-03-07 17:05:48 -05:00
f05496632a add grpc support 2025-03-06 17:20:27 -05:00
ffac524cfc add grpc support 2025-03-06 17:20:02 -05:00
64ca321c3a tweak spans
All checks were successful
Build and Publish / release (push) Successful in 2m58s
2025-03-05 13:32:39 -05:00
3329c980a9 tweak spans
All checks were successful
Build and Publish / release (push) Successful in 3m23s
2025-03-05 13:23:04 -05:00
b4412a461f tweak spans
All checks were successful
Build and Publish / release (push) Successful in 3m22s
2025-03-05 13:18:37 -05:00
042fd221c4 move enrich span end to defer 2025-03-05 13:04:11 -05:00
37 changed files with 2540 additions and 152 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
.git
config.y*ml
go.work*
docker-compose-sample*

View File

@ -16,7 +16,7 @@ env:
DOCKER_USER: rmcguire
DOCKER_REPO: rmcguire/ambient-local-exporter
DOCKER_IMG: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPO }}
CHART_DIR: helm/ambient-local-exporter
jobs:
release:
@ -86,3 +86,29 @@ jobs:
build-args: |
VER_PKG=${{ env.VER_PKG }}
VERSION=${{ github.ref_name }}
helm-release:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Helm
env:
BINARY_NAME: helm
run: |
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Package Chart
run: |
helm package --app-version ${VERSION#v} ${CHART_DIR}
- name: Publish Chart
env:
API_TOKEN: ${{ secrets.API_TOKEN }}
run: |
curl -X POST \
-H "Authorization: token ${API_TOKEN}" \
--upload-file ./${PACKAGE_NAME}-*.tgz \
https://gitea.libretechconsulting.com/api/packages/${GITHUB_REPOSITORY_OWNER}/helm/api/charts

6
.gitignore vendored
View File

@ -26,5 +26,9 @@ go.work.sum
bin/*
config.yaml
config.y*ml
docker-compose.yml
.vscode
helm/values*.y*ml
helm_upgrade.sh

View File

@ -1,14 +1,23 @@
CMD_NAME := ambient-local-exporter
.PHONY: all test build docker install clean
.PHONY: all test build docker install clean proto check_protoc
VERSION ?= development # Default to "development" if VERSION is not set
APIVERSION := v1alpha1
API_DIR := api/$(APIVERSION)
PROTO_DIRS := $(wildcard proto/*)
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
OUTPUT_DIR := bin
VER_PKG := gitea.libretechconsulting.com/rmcguire/go-app/pkg/config.Version
DOCKER_IMG := gitea.libretechconsulting.com/rmcguire/ambient-local-exporter
all: test build docker
all: proto test build docker
proto: check_protoc $(API_DIR)
protoc --proto_path=proto \
--go_out=$(API_DIR) --go_opt=paths=source_relative \
--go-grpc_out=$(API_DIR) --go-grpc_opt=paths=source_relative \
$(foreach dir, $(PROTO_DIRS), $(wildcard $(dir)/*.proto))
test:
go test -v ./...
@ -37,3 +46,13 @@ install:
clean:
rm -rf bin/${CMD_NAME}
check_protoc:
@if ! command -v protoc-gen-go > /dev/null; then \
echo "Error: protoc-gen-go not found in PATH"; \
exit 1; \
fi
@if ! command -v protoc-gen-go-grpc > /dev/null; then \
echo "Error: protoc-gen-go-grpc not found in PATH"; \
exit 1; \
fi

View File

@ -1,3 +1,3 @@
# ambient-weather-local-exporter
# ambient-local-exporter
A simple exporter that takes data from an Ambient Weather weather station or Weather Hub. Requires no internet connection, and does not use any cloud APIs.

View File

@ -1,10 +1,11 @@
# TODO
- [ ] Helm Chart
- [ ] Finish implementing weather GRPC
- [ ] Update README
- [ ] Add Grafana dashboard
- [ ] Add new spans
## Done
- [x] Helm Chart
- [x] Add proxy to upstream support
- [x] Fix wunderground 401
- [x] Perform proxy calls in goroutines

View File

@ -0,0 +1,763 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.5
// protoc v5.29.3
// source: weather/weather.proto
package weather
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type GetWeatherRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Opts *GetWeatherOpts `protobuf:"bytes,1,opt,name=opts,proto3" json:"opts,omitempty"`
Limit *int32 `protobuf:"varint,2,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetWeatherRequest) Reset() {
*x = GetWeatherRequest{}
mi := &file_weather_weather_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetWeatherRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetWeatherRequest) ProtoMessage() {}
func (x *GetWeatherRequest) ProtoReflect() protoreflect.Message {
mi := &file_weather_weather_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetWeatherRequest.ProtoReflect.Descriptor instead.
func (*GetWeatherRequest) Descriptor() ([]byte, []int) {
return file_weather_weather_proto_rawDescGZIP(), []int{0}
}
func (x *GetWeatherRequest) GetOpts() *GetWeatherOpts {
if x != nil {
return x.Opts
}
return nil
}
func (x *GetWeatherRequest) GetLimit() int32 {
if x != nil && x.Limit != nil {
return *x.Limit
}
return 0
}
type GetWeatherResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
LastUpdated *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
WeatherUpdates []*WeatherUpdate `protobuf:"bytes,2,rep,name=weather_updates,json=weatherUpdates,proto3" json:"weather_updates,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetWeatherResponse) Reset() {
*x = GetWeatherResponse{}
mi := &file_weather_weather_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetWeatherResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetWeatherResponse) ProtoMessage() {}
func (x *GetWeatherResponse) ProtoReflect() protoreflect.Message {
mi := &file_weather_weather_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetWeatherResponse.ProtoReflect.Descriptor instead.
func (*GetWeatherResponse) Descriptor() ([]byte, []int) {
return file_weather_weather_proto_rawDescGZIP(), []int{1}
}
func (x *GetWeatherResponse) GetLastUpdated() *timestamppb.Timestamp {
if x != nil {
return x.LastUpdated
}
return nil
}
func (x *GetWeatherResponse) GetWeatherUpdates() []*WeatherUpdate {
if x != nil {
return x.WeatherUpdates
}
return nil
}
type GetWeatherOpts struct {
state protoimpl.MessageState `protogen:"open.v1"`
StationName *string `protobuf:"bytes,1,opt,name=station_name,json=stationName,proto3,oneof" json:"station_name,omitempty"`
StationType *string `protobuf:"bytes,2,opt,name=station_type,json=stationType,proto3,oneof" json:"station_type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetWeatherOpts) Reset() {
*x = GetWeatherOpts{}
mi := &file_weather_weather_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetWeatherOpts) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetWeatherOpts) ProtoMessage() {}
func (x *GetWeatherOpts) ProtoReflect() protoreflect.Message {
mi := &file_weather_weather_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetWeatherOpts.ProtoReflect.Descriptor instead.
func (*GetWeatherOpts) Descriptor() ([]byte, []int) {
return file_weather_weather_proto_rawDescGZIP(), []int{2}
}
func (x *GetWeatherOpts) GetStationName() string {
if x != nil && x.StationName != nil {
return *x.StationName
}
return ""
}
func (x *GetWeatherOpts) GetStationType() string {
if x != nil && x.StationType != nil {
return *x.StationType
}
return ""
}
type WeatherUpdate struct {
state protoimpl.MessageState `protogen:"open.v1"`
StationName string `protobuf:"bytes,1,opt,name=station_name,json=stationName,proto3" json:"station_name,omitempty"`
StationType string `protobuf:"bytes,2,opt,name=station_type,json=stationType,proto3" json:"station_type,omitempty"`
StationId string `protobuf:"bytes,3,opt,name=station_id,json=stationId,proto3" json:"station_id,omitempty"`
TempOutdoorF *float64 `protobuf:"fixed64,4,opt,name=temp_outdoor_f,json=tempOutdoorF,proto3,oneof" json:"temp_outdoor_f,omitempty"`
TempIndoorF *float64 `protobuf:"fixed64,5,opt,name=temp_indoor_f,json=tempIndoorF,proto3,oneof" json:"temp_indoor_f,omitempty"`
HumidityOutdoor *int32 `protobuf:"varint,6,opt,name=humidity_outdoor,json=humidityOutdoor,proto3,oneof" json:"humidity_outdoor,omitempty"`
HumidityIndoor *int32 `protobuf:"varint,7,opt,name=humidity_indoor,json=humidityIndoor,proto3,oneof" json:"humidity_indoor,omitempty"`
WindSpeedMph *float64 `protobuf:"fixed64,8,opt,name=wind_speed_mph,json=windSpeedMph,proto3,oneof" json:"wind_speed_mph,omitempty"`
WindGustMph *float64 `protobuf:"fixed64,9,opt,name=wind_gust_mph,json=windGustMph,proto3,oneof" json:"wind_gust_mph,omitempty"`
MaxDailyGust *float64 `protobuf:"fixed64,10,opt,name=max_daily_gust,json=maxDailyGust,proto3,oneof" json:"max_daily_gust,omitempty"`
WindDir *int32 `protobuf:"varint,11,opt,name=wind_dir,json=windDir,proto3,oneof" json:"wind_dir,omitempty"`
WindDirAvg_10M *int32 `protobuf:"varint,12,opt,name=wind_dir_avg_10m,json=windDirAvg10m,proto3,oneof" json:"wind_dir_avg_10m,omitempty"`
Uv *int32 `protobuf:"varint,13,opt,name=uv,proto3,oneof" json:"uv,omitempty"`
SolarRadiation *float64 `protobuf:"fixed64,14,opt,name=solar_radiation,json=solarRadiation,proto3,oneof" json:"solar_radiation,omitempty"`
HourlyRainIn *float64 `protobuf:"fixed64,15,opt,name=hourly_rain_in,json=hourlyRainIn,proto3,oneof" json:"hourly_rain_in,omitempty"`
EventRainIn *float64 `protobuf:"fixed64,16,opt,name=event_rain_in,json=eventRainIn,proto3,oneof" json:"event_rain_in,omitempty"`
DailyRainIn *float64 `protobuf:"fixed64,17,opt,name=daily_rain_in,json=dailyRainIn,proto3,oneof" json:"daily_rain_in,omitempty"`
WeeklyRainIn *float64 `protobuf:"fixed64,18,opt,name=weekly_rain_in,json=weeklyRainIn,proto3,oneof" json:"weekly_rain_in,omitempty"`
MonthlyRainIn *float64 `protobuf:"fixed64,19,opt,name=monthly_rain_in,json=monthlyRainIn,proto3,oneof" json:"monthly_rain_in,omitempty"`
YearlyRainIn *float64 `protobuf:"fixed64,20,opt,name=yearly_rain_in,json=yearlyRainIn,proto3,oneof" json:"yearly_rain_in,omitempty"`
TotalRainIn *float64 `protobuf:"fixed64,21,opt,name=total_rain_in,json=totalRainIn,proto3,oneof" json:"total_rain_in,omitempty"`
Batteries []*BatteryStatus `protobuf:"bytes,22,rep,name=batteries,proto3" json:"batteries,omitempty"`
BaromRelativeIn *float64 `protobuf:"fixed64,23,opt,name=barom_relative_in,json=baromRelativeIn,proto3,oneof" json:"barom_relative_in,omitempty"`
BaromAbsoluteIn *float64 `protobuf:"fixed64,24,opt,name=barom_absolute_in,json=baromAbsoluteIn,proto3,oneof" json:"barom_absolute_in,omitempty"`
DewPointF *float64 `protobuf:"fixed64,25,opt,name=dew_point_f,json=dewPointF,proto3,oneof" json:"dew_point_f,omitempty"`
WindChillF *float64 `protobuf:"fixed64,26,opt,name=wind_chill_f,json=windChillF,proto3,oneof" json:"wind_chill_f,omitempty"`
TempHumiditySensors []*TempHumiditySensor `protobuf:"bytes,27,rep,name=temp_humidity_sensors,json=tempHumiditySensors,proto3" json:"temp_humidity_sensors,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *WeatherUpdate) Reset() {
*x = WeatherUpdate{}
mi := &file_weather_weather_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *WeatherUpdate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WeatherUpdate) ProtoMessage() {}
func (x *WeatherUpdate) ProtoReflect() protoreflect.Message {
mi := &file_weather_weather_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WeatherUpdate.ProtoReflect.Descriptor instead.
func (*WeatherUpdate) Descriptor() ([]byte, []int) {
return file_weather_weather_proto_rawDescGZIP(), []int{3}
}
func (x *WeatherUpdate) GetStationName() string {
if x != nil {
return x.StationName
}
return ""
}
func (x *WeatherUpdate) GetStationType() string {
if x != nil {
return x.StationType
}
return ""
}
func (x *WeatherUpdate) GetStationId() string {
if x != nil {
return x.StationId
}
return ""
}
func (x *WeatherUpdate) GetTempOutdoorF() float64 {
if x != nil && x.TempOutdoorF != nil {
return *x.TempOutdoorF
}
return 0
}
func (x *WeatherUpdate) GetTempIndoorF() float64 {
if x != nil && x.TempIndoorF != nil {
return *x.TempIndoorF
}
return 0
}
func (x *WeatherUpdate) GetHumidityOutdoor() int32 {
if x != nil && x.HumidityOutdoor != nil {
return *x.HumidityOutdoor
}
return 0
}
func (x *WeatherUpdate) GetHumidityIndoor() int32 {
if x != nil && x.HumidityIndoor != nil {
return *x.HumidityIndoor
}
return 0
}
func (x *WeatherUpdate) GetWindSpeedMph() float64 {
if x != nil && x.WindSpeedMph != nil {
return *x.WindSpeedMph
}
return 0
}
func (x *WeatherUpdate) GetWindGustMph() float64 {
if x != nil && x.WindGustMph != nil {
return *x.WindGustMph
}
return 0
}
func (x *WeatherUpdate) GetMaxDailyGust() float64 {
if x != nil && x.MaxDailyGust != nil {
return *x.MaxDailyGust
}
return 0
}
func (x *WeatherUpdate) GetWindDir() int32 {
if x != nil && x.WindDir != nil {
return *x.WindDir
}
return 0
}
func (x *WeatherUpdate) GetWindDirAvg_10M() int32 {
if x != nil && x.WindDirAvg_10M != nil {
return *x.WindDirAvg_10M
}
return 0
}
func (x *WeatherUpdate) GetUv() int32 {
if x != nil && x.Uv != nil {
return *x.Uv
}
return 0
}
func (x *WeatherUpdate) GetSolarRadiation() float64 {
if x != nil && x.SolarRadiation != nil {
return *x.SolarRadiation
}
return 0
}
func (x *WeatherUpdate) GetHourlyRainIn() float64 {
if x != nil && x.HourlyRainIn != nil {
return *x.HourlyRainIn
}
return 0
}
func (x *WeatherUpdate) GetEventRainIn() float64 {
if x != nil && x.EventRainIn != nil {
return *x.EventRainIn
}
return 0
}
func (x *WeatherUpdate) GetDailyRainIn() float64 {
if x != nil && x.DailyRainIn != nil {
return *x.DailyRainIn
}
return 0
}
func (x *WeatherUpdate) GetWeeklyRainIn() float64 {
if x != nil && x.WeeklyRainIn != nil {
return *x.WeeklyRainIn
}
return 0
}
func (x *WeatherUpdate) GetMonthlyRainIn() float64 {
if x != nil && x.MonthlyRainIn != nil {
return *x.MonthlyRainIn
}
return 0
}
func (x *WeatherUpdate) GetYearlyRainIn() float64 {
if x != nil && x.YearlyRainIn != nil {
return *x.YearlyRainIn
}
return 0
}
func (x *WeatherUpdate) GetTotalRainIn() float64 {
if x != nil && x.TotalRainIn != nil {
return *x.TotalRainIn
}
return 0
}
func (x *WeatherUpdate) GetBatteries() []*BatteryStatus {
if x != nil {
return x.Batteries
}
return nil
}
func (x *WeatherUpdate) GetBaromRelativeIn() float64 {
if x != nil && x.BaromRelativeIn != nil {
return *x.BaromRelativeIn
}
return 0
}
func (x *WeatherUpdate) GetBaromAbsoluteIn() float64 {
if x != nil && x.BaromAbsoluteIn != nil {
return *x.BaromAbsoluteIn
}
return 0
}
func (x *WeatherUpdate) GetDewPointF() float64 {
if x != nil && x.DewPointF != nil {
return *x.DewPointF
}
return 0
}
func (x *WeatherUpdate) GetWindChillF() float64 {
if x != nil && x.WindChillF != nil {
return *x.WindChillF
}
return 0
}
func (x *WeatherUpdate) GetTempHumiditySensors() []*TempHumiditySensor {
if x != nil {
return x.TempHumiditySensors
}
return nil
}
// Represents a temperature and humidity sensor
type TempHumiditySensor struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
TempF *float64 `protobuf:"fixed64,2,opt,name=temp_f,json=tempF,proto3,oneof" json:"temp_f,omitempty"`
Humidity *int32 `protobuf:"varint,3,opt,name=humidity,proto3,oneof" json:"humidity,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TempHumiditySensor) Reset() {
*x = TempHumiditySensor{}
mi := &file_weather_weather_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TempHumiditySensor) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TempHumiditySensor) ProtoMessage() {}
func (x *TempHumiditySensor) ProtoReflect() protoreflect.Message {
mi := &file_weather_weather_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TempHumiditySensor.ProtoReflect.Descriptor instead.
func (*TempHumiditySensor) Descriptor() ([]byte, []int) {
return file_weather_weather_proto_rawDescGZIP(), []int{4}
}
func (x *TempHumiditySensor) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *TempHumiditySensor) GetTempF() float64 {
if x != nil && x.TempF != nil {
return *x.TempF
}
return 0
}
func (x *TempHumiditySensor) GetHumidity() int32 {
if x != nil && x.Humidity != nil {
return *x.Humidity
}
return 0
}
// Represents battery status for different components
type BatteryStatus struct {
state protoimpl.MessageState `protogen:"open.v1"`
Component string `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"`
Status *int32 `protobuf:"varint,2,opt,name=status,proto3,oneof" json:"status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BatteryStatus) Reset() {
*x = BatteryStatus{}
mi := &file_weather_weather_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *BatteryStatus) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BatteryStatus) ProtoMessage() {}
func (x *BatteryStatus) ProtoReflect() protoreflect.Message {
mi := &file_weather_weather_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BatteryStatus.ProtoReflect.Descriptor instead.
func (*BatteryStatus) Descriptor() ([]byte, []int) {
return file_weather_weather_proto_rawDescGZIP(), []int{5}
}
func (x *BatteryStatus) GetComponent() string {
if x != nil {
return x.Component
}
return ""
}
func (x *BatteryStatus) GetStatus() int32 {
if x != nil && x.Status != nil {
return *x.Status
}
return 0
}
var File_weather_weather_proto protoreflect.FileDescriptor
var file_weather_weather_proto_rawDesc = string([]byte{
0x0a, 0x15, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65,
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74,
0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x11, 0x47, 0x65, 0x74,
0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33,
0x0a, 0x04, 0x6f, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61,
0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x47,
0x65, 0x74, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x73, 0x52, 0x04, 0x6f,
0x70, 0x74, 0x73, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x42, 0x08,
0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x9c, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74,
0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x3d, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x47,
0x0a, 0x0f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e,
0x74, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65,
0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x57,
0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x88,
0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79,
0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x73,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f,
0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xb7, 0x0c, 0x0a,
0x0d, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21,
0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x6f, 0x75, 0x74, 0x64,
0x6f, 0x6f, 0x72, 0x5f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x74,
0x65, 0x6d, 0x70, 0x4f, 0x75, 0x74, 0x64, 0x6f, 0x6f, 0x72, 0x46, 0x88, 0x01, 0x01, 0x12, 0x27,
0x0a, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x69, 0x6e, 0x64, 0x6f, 0x6f, 0x72, 0x5f, 0x66, 0x18,
0x05, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x49, 0x6e, 0x64,
0x6f, 0x6f, 0x72, 0x46, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x10, 0x68, 0x75, 0x6d, 0x69, 0x64,
0x69, 0x74, 0x79, 0x5f, 0x6f, 0x75, 0x74, 0x64, 0x6f, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28,
0x05, 0x48, 0x02, 0x52, 0x0f, 0x68, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x4f, 0x75, 0x74,
0x64, 0x6f, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x0f, 0x68, 0x75, 0x6d, 0x69, 0x64,
0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x6f, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05,
0x48, 0x03, 0x52, 0x0e, 0x68, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x64, 0x6f,
0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x73, 0x70,
0x65, 0x65, 0x64, 0x5f, 0x6d, 0x70, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x48, 0x04, 0x52,
0x0c, 0x77, 0x69, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x65, 0x64, 0x4d, 0x70, 0x68, 0x88, 0x01, 0x01,
0x12, 0x27, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x67, 0x75, 0x73, 0x74, 0x5f, 0x6d, 0x70,
0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x48, 0x05, 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x64, 0x47,
0x75, 0x73, 0x74, 0x4d, 0x70, 0x68, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x6d, 0x61, 0x78,
0x5f, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x67, 0x75, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x01, 0x48, 0x06, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x47, 0x75, 0x73,
0x74, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x64, 0x69, 0x72,
0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x48, 0x07, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x64, 0x44, 0x69,
0x72, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x64, 0x69, 0x72,
0x5f, 0x61, 0x76, 0x67, 0x5f, 0x31, 0x30, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x48, 0x08,
0x52, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x44, 0x69, 0x72, 0x41, 0x76, 0x67, 0x31, 0x30, 0x6d, 0x88,
0x01, 0x01, 0x12, 0x13, 0x0a, 0x02, 0x75, 0x76, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x48, 0x09,
0x52, 0x02, 0x75, 0x76, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x0f, 0x73, 0x6f, 0x6c, 0x61, 0x72,
0x5f, 0x72, 0x61, 0x64, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01,
0x48, 0x0a, 0x52, 0x0e, 0x73, 0x6f, 0x6c, 0x61, 0x72, 0x52, 0x61, 0x64, 0x69, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x68, 0x6f, 0x75, 0x72, 0x6c, 0x79, 0x5f,
0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x01, 0x48, 0x0b, 0x52,
0x0c, 0x68, 0x6f, 0x75, 0x72, 0x6c, 0x79, 0x52, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x88, 0x01, 0x01,
0x12, 0x27, 0x0a, 0x0d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69,
0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x01, 0x48, 0x0c, 0x52, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x52, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0d, 0x64, 0x61, 0x69,
0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01,
0x48, 0x0d, 0x52, 0x0b, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x52, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x88,
0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x77, 0x65, 0x65, 0x6b, 0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69,
0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x48, 0x0e, 0x52, 0x0c, 0x77, 0x65,
0x65, 0x6b, 0x6c, 0x79, 0x52, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a,
0x0f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e,
0x18, 0x13, 0x20, 0x01, 0x28, 0x01, 0x48, 0x0f, 0x52, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c,
0x79, 0x52, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x79, 0x65,
0x61, 0x72, 0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x14, 0x20, 0x01,
0x28, 0x01, 0x48, 0x10, 0x52, 0x0c, 0x79, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x52, 0x61, 0x69, 0x6e,
0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72,
0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x01, 0x48, 0x11, 0x52, 0x0b,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x3c,
0x0a, 0x09, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x65, 0x61, 0x74,
0x68, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x09, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x11,
0x62, 0x61, 0x72, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69,
0x6e, 0x18, 0x17, 0x20, 0x01, 0x28, 0x01, 0x48, 0x12, 0x52, 0x0f, 0x62, 0x61, 0x72, 0x6f, 0x6d,
0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a,
0x11, 0x62, 0x61, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x5f,
0x69, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x48, 0x13, 0x52, 0x0f, 0x62, 0x61, 0x72, 0x6f,
0x6d, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x23,
0x0a, 0x0b, 0x64, 0x65, 0x77, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x66, 0x18, 0x19, 0x20,
0x01, 0x28, 0x01, 0x48, 0x14, 0x52, 0x09, 0x64, 0x65, 0x77, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x46,
0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x63, 0x68, 0x69, 0x6c,
0x6c, 0x5f, 0x66, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x01, 0x48, 0x15, 0x52, 0x0a, 0x77, 0x69, 0x6e,
0x64, 0x43, 0x68, 0x69, 0x6c, 0x6c, 0x46, 0x88, 0x01, 0x01, 0x12, 0x57, 0x0a, 0x15, 0x74, 0x65,
0x6d, 0x70, 0x5f, 0x68, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x6e, 0x73,
0x6f, 0x72, 0x73, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x6d, 0x62, 0x69,
0x65, 0x6e, 0x74, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70,
0x48, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x52, 0x13,
0x74, 0x65, 0x6d, 0x70, 0x48, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x53, 0x65, 0x6e, 0x73,
0x6f, 0x72, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x6f, 0x75, 0x74,
0x64, 0x6f, 0x6f, 0x72, 0x5f, 0x66, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f,
0x69, 0x6e, 0x64, 0x6f, 0x6f, 0x72, 0x5f, 0x66, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x68, 0x75, 0x6d,
0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x75, 0x74, 0x64, 0x6f, 0x6f, 0x72, 0x42, 0x12, 0x0a,
0x10, 0x5f, 0x68, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x6f, 0x6f,
0x72, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64,
0x5f, 0x6d, 0x70, 0x68, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x67, 0x75,
0x73, 0x74, 0x5f, 0x6d, 0x70, 0x68, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x64,
0x61, 0x69, 0x6c, 0x79, 0x5f, 0x67, 0x75, 0x73, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x77, 0x69,
0x6e, 0x64, 0x5f, 0x64, 0x69, 0x72, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x5f,
0x64, 0x69, 0x72, 0x5f, 0x61, 0x76, 0x67, 0x5f, 0x31, 0x30, 0x6d, 0x42, 0x05, 0x0a, 0x03, 0x5f,
0x75, 0x76, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x73, 0x6f, 0x6c, 0x61, 0x72, 0x5f, 0x72, 0x61, 0x64,
0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x6c,
0x79, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x5f,
0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x42, 0x11, 0x0a,
0x0f, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e,
0x42, 0x12, 0x0a, 0x10, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x72, 0x61, 0x69,
0x6e, 0x5f, 0x69, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x5f,
0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x74, 0x6f, 0x74, 0x61,
0x6c, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x62, 0x61,
0x72, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x42,
0x14, 0x0a, 0x12, 0x5f, 0x62, 0x61, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75,
0x74, 0x65, 0x5f, 0x69, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x77, 0x5f, 0x70, 0x6f,
0x69, 0x6e, 0x74, 0x5f, 0x66, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x5f, 0x63,
0x68, 0x69, 0x6c, 0x6c, 0x5f, 0x66, 0x22, 0x7d, 0x0a, 0x12, 0x54, 0x65, 0x6d, 0x70, 0x48, 0x75,
0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x1a, 0x0a, 0x06, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01,
0x48, 0x00, 0x52, 0x05, 0x74, 0x65, 0x6d, 0x70, 0x46, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08,
0x68, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01,
0x52, 0x08, 0x68, 0x75, 0x6d, 0x69, 0x64, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a,
0x07, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x66, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x68, 0x75, 0x6d,
0x69, 0x64, 0x69, 0x74, 0x79, 0x22, 0x55, 0x0a, 0x0d, 0x42, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e,
0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f,
0x6e, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x88, 0x01,
0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x54, 0x5a, 0x52,
0x67, 0x69, 0x74, 0x65, 0x61, 0x2e, 0x6c, 0x69, 0x62, 0x72, 0x65, 0x74, 0x65, 0x63, 0x68, 0x63,
0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6d,
0x63, 0x67, 0x75, 0x69, 0x72, 0x65, 0x2f, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c,
0x6f, 0x63, 0x61, 0x6c, 0x2d, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68,
0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
file_weather_weather_proto_rawDescOnce sync.Once
file_weather_weather_proto_rawDescData []byte
)
func file_weather_weather_proto_rawDescGZIP() []byte {
file_weather_weather_proto_rawDescOnce.Do(func() {
file_weather_weather_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_weather_weather_proto_rawDesc), len(file_weather_weather_proto_rawDesc)))
})
return file_weather_weather_proto_rawDescData
}
var file_weather_weather_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_weather_weather_proto_goTypes = []any{
(*GetWeatherRequest)(nil), // 0: ambient.weather.GetWeatherRequest
(*GetWeatherResponse)(nil), // 1: ambient.weather.GetWeatherResponse
(*GetWeatherOpts)(nil), // 2: ambient.weather.GetWeatherOpts
(*WeatherUpdate)(nil), // 3: ambient.weather.WeatherUpdate
(*TempHumiditySensor)(nil), // 4: ambient.weather.TempHumiditySensor
(*BatteryStatus)(nil), // 5: ambient.weather.BatteryStatus
(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
}
var file_weather_weather_proto_depIdxs = []int32{
2, // 0: ambient.weather.GetWeatherRequest.opts:type_name -> ambient.weather.GetWeatherOpts
6, // 1: ambient.weather.GetWeatherResponse.last_updated:type_name -> google.protobuf.Timestamp
3, // 2: ambient.weather.GetWeatherResponse.weather_updates:type_name -> ambient.weather.WeatherUpdate
5, // 3: ambient.weather.WeatherUpdate.batteries:type_name -> ambient.weather.BatteryStatus
4, // 4: ambient.weather.WeatherUpdate.temp_humidity_sensors:type_name -> ambient.weather.TempHumiditySensor
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_weather_weather_proto_init() }
func file_weather_weather_proto_init() {
if File_weather_weather_proto != nil {
return
}
file_weather_weather_proto_msgTypes[0].OneofWrappers = []any{}
file_weather_weather_proto_msgTypes[2].OneofWrappers = []any{}
file_weather_weather_proto_msgTypes[3].OneofWrappers = []any{}
file_weather_weather_proto_msgTypes[4].OneofWrappers = []any{}
file_weather_weather_proto_msgTypes[5].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_weather_weather_proto_rawDesc), len(file_weather_weather_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_weather_weather_proto_goTypes,
DependencyIndexes: file_weather_weather_proto_depIdxs,
MessageInfos: file_weather_weather_proto_msgTypes,
}.Build()
File_weather_weather_proto = out.File
file_weather_weather_proto_goTypes = nil
file_weather_weather_proto_depIdxs = nil
}

View File

@ -0,0 +1,82 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.5
// protoc v5.29.3
// source: weather/weather_service.proto
package weather
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_weather_weather_service_proto protoreflect.FileDescriptor
var file_weather_weather_service_proto_rawDesc = string([]byte{
0x0a, 0x1d, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65,
0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x0f, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72,
0x1a, 0x15, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65,
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x73, 0x0a, 0x1a, 0x41, 0x6d, 0x62, 0x69, 0x65,
0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x57, 0x65, 0x61, 0x74,
0x68, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x65,
0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e,
0x74, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x65, 0x61,
0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x54, 0x5a, 0x52,
0x67, 0x69, 0x74, 0x65, 0x61, 0x2e, 0x6c, 0x69, 0x62, 0x72, 0x65, 0x74, 0x65, 0x63, 0x68, 0x63,
0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6d,
0x63, 0x67, 0x75, 0x69, 0x72, 0x65, 0x2f, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c,
0x6f, 0x63, 0x61, 0x6c, 0x2d, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68,
0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var file_weather_weather_service_proto_goTypes = []any{
(*GetWeatherRequest)(nil), // 0: ambient.weather.GetWeatherRequest
(*GetWeatherResponse)(nil), // 1: ambient.weather.GetWeatherResponse
}
var file_weather_weather_service_proto_depIdxs = []int32{
0, // 0: ambient.weather.AmbientLocalWeatherService.GetWeather:input_type -> ambient.weather.GetWeatherRequest
1, // 1: ambient.weather.AmbientLocalWeatherService.GetWeather:output_type -> ambient.weather.GetWeatherResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_weather_weather_service_proto_init() }
func file_weather_weather_service_proto_init() {
if File_weather_weather_service_proto != nil {
return
}
file_weather_weather_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_weather_weather_service_proto_rawDesc), len(file_weather_weather_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_weather_weather_service_proto_goTypes,
DependencyIndexes: file_weather_weather_service_proto_depIdxs,
}.Build()
File_weather_weather_service_proto = out.File
file_weather_weather_service_proto_goTypes = nil
file_weather_weather_service_proto_depIdxs = nil
}

View File

@ -0,0 +1,122 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.3
// source: weather/weather_service.proto
package weather
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
AmbientLocalWeatherService_GetWeather_FullMethodName = "/ambient.weather.AmbientLocalWeatherService/GetWeather"
)
// AmbientLocalWeatherServiceClient is the client API for AmbientLocalWeatherService 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.
type AmbientLocalWeatherServiceClient interface {
GetWeather(ctx context.Context, in *GetWeatherRequest, opts ...grpc.CallOption) (*GetWeatherResponse, error)
}
type ambientLocalWeatherServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAmbientLocalWeatherServiceClient(cc grpc.ClientConnInterface) AmbientLocalWeatherServiceClient {
return &ambientLocalWeatherServiceClient{cc}
}
func (c *ambientLocalWeatherServiceClient) GetWeather(ctx context.Context, in *GetWeatherRequest, opts ...grpc.CallOption) (*GetWeatherResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetWeatherResponse)
err := c.cc.Invoke(ctx, AmbientLocalWeatherService_GetWeather_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AmbientLocalWeatherServiceServer is the server API for AmbientLocalWeatherService service.
// All implementations must embed UnimplementedAmbientLocalWeatherServiceServer
// for forward compatibility.
type AmbientLocalWeatherServiceServer interface {
GetWeather(context.Context, *GetWeatherRequest) (*GetWeatherResponse, error)
mustEmbedUnimplementedAmbientLocalWeatherServiceServer()
}
// UnimplementedAmbientLocalWeatherServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAmbientLocalWeatherServiceServer struct{}
func (UnimplementedAmbientLocalWeatherServiceServer) GetWeather(context.Context, *GetWeatherRequest) (*GetWeatherResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetWeather not implemented")
}
func (UnimplementedAmbientLocalWeatherServiceServer) mustEmbedUnimplementedAmbientLocalWeatherServiceServer() {
}
func (UnimplementedAmbientLocalWeatherServiceServer) testEmbeddedByValue() {}
// UnsafeAmbientLocalWeatherServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AmbientLocalWeatherServiceServer will
// result in compilation errors.
type UnsafeAmbientLocalWeatherServiceServer interface {
mustEmbedUnimplementedAmbientLocalWeatherServiceServer()
}
func RegisterAmbientLocalWeatherServiceServer(s grpc.ServiceRegistrar, srv AmbientLocalWeatherServiceServer) {
// If the following call pancis, it indicates UnimplementedAmbientLocalWeatherServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AmbientLocalWeatherService_ServiceDesc, srv)
}
func _AmbientLocalWeatherService_GetWeather_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetWeatherRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AmbientLocalWeatherServiceServer).GetWeather(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AmbientLocalWeatherService_GetWeather_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AmbientLocalWeatherServiceServer).GetWeather(ctx, req.(*GetWeatherRequest))
}
return interceptor(ctx, in, info, handler)
}
// AmbientLocalWeatherService_ServiceDesc is the grpc.ServiceDesc for AmbientLocalWeatherService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AmbientLocalWeatherService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ambient.weather.AmbientLocalWeatherService",
HandlerType: (*AmbientLocalWeatherServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetWeather",
Handler: _AmbientLocalWeatherService_GetWeather_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "weather/weather_service.proto",
}

26
docker-compose-sample.yml Normal file
View File

@ -0,0 +1,26 @@
name: Ambient Local Exporter
services:
ambient-local-exporter:
build: .
ports:
- 8080:8080
volumes:
- ./config.yaml:/app/config.yaml
command:
- -config
- /app/config.yaml
environment:
APP_NAME: ambient-local-exporter
APP_LOG_LEVEL: debug ## For testing only
APP_LOG_FORMAT: json ## console, json
APP_LOG_TIME_FORMAT: rfc3339 ## long, short, unix, rfc3339, off
APP_HTTP_LISTEN: 0.0.0.0:8080
APP_HTTP_READ_TIMEOUT: 10s
APP_HTTP_WRITE_TIMEOUT: 10s
APP_HTTP_IDLE_TIMEOUT: 30s
APP_HTTP_LOG_REQUESTS: true
APP_OTEL_STDOUT_ENABLED: false
APP_OTEL_METRIC_INTERVAL_SECS: 30
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel.libretechconsulting.com:4317 # Set to your otel collector
OTEL_SERVICE_NAME: ambient-local-exporter
OTEL_RESOURCE_ATTRIBUTES: "env=development,service.version=(devel)"

40
go.mod
View File

@ -1,15 +1,18 @@
module gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter
module gitea.libretechconsulting.com/rmcguire/ambient-local-exporter
go 1.23.4
require (
gitea.libretechconsulting.com/rmcguire/go-app v0.5.1
gitea.libretechconsulting.com/rmcguire/go-app v0.6.3
github.com/go-resty/resty/v2 v2.16.5
github.com/gorilla/schema v1.4.1
github.com/rs/zerolog v1.33.0
go.opentelemetry.io/otel v1.34.0
go.opentelemetry.io/otel/metric v1.34.0
golang.org/x/sys v0.30.0
go.opentelemetry.io/otel v1.35.0
go.opentelemetry.io/otel/metric v1.35.0
go.opentelemetry.io/otel/trace v1.35.0
golang.org/x/sys v0.31.0
google.golang.org/grpc v1.71.0
google.golang.org/protobuf v1.36.5
k8s.io/utils v0.0.0-20241210054802-24370beab758
)
@ -22,6 +25,7 @@ require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
@ -32,22 +36,20 @@ require (
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.56.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.57.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0 // indirect
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/net v0.36.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/grpc v1.71.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

111
go.sum
View File

@ -1,13 +1,9 @@
gitea.libretechconsulting.com/rmcguire/go-app v0.4.0 h1:iEGuA2D15rniiKlgejykxvs0TBD9JigEVnhYiCNppw4=
gitea.libretechconsulting.com/rmcguire/go-app v0.4.0/go.mod h1:ug6g+FyEi2LguWTQfd+bZrTd1ECsot8BylxgMFEO5DM=
gitea.libretechconsulting.com/rmcguire/go-app v0.4.1 h1:gjDg2M/j1AdMCtkXqQnLCo6jJUSWQOj56ehfU1S6BGE=
gitea.libretechconsulting.com/rmcguire/go-app v0.4.1/go.mod h1:9c71S+sJb2NqvOwt3CFsW5WjE895goiRlMTdLimgwHs=
gitea.libretechconsulting.com/rmcguire/go-app v0.4.2 h1:LQxVLXEHruY32GaMsS5K/tMdjS5kvw6reUh25gshn40=
gitea.libretechconsulting.com/rmcguire/go-app v0.4.2/go.mod h1:9c71S+sJb2NqvOwt3CFsW5WjE895goiRlMTdLimgwHs=
gitea.libretechconsulting.com/rmcguire/go-app v0.5.0 h1:5yYyaXXN5KcxMIPBYLZKztvKGMlYol3+oqzUnkvHBaQ=
gitea.libretechconsulting.com/rmcguire/go-app v0.5.0/go.mod h1:9c71S+sJb2NqvOwt3CFsW5WjE895goiRlMTdLimgwHs=
gitea.libretechconsulting.com/rmcguire/go-app v0.5.1 h1:ONphNgJUWMcLIAR9OqCsRa1IuEBChMbRvS1he9xRt2Y=
gitea.libretechconsulting.com/rmcguire/go-app v0.5.1/go.mod h1:QMAlmZVUYvXiEiTvYUDzJ0A5oUu7wSMLy2fM+ma21ME=
gitea.libretechconsulting.com/rmcguire/go-app v0.6.0 h1:XIqk2xpKZ+GzCyh3ZpST93nu+WqteXBPCRcWVliEiks=
gitea.libretechconsulting.com/rmcguire/go-app v0.6.0/go.mod h1:S3/vdMEiRWWIdD0Fr+tjJc627VzxNzO4Ia2HgTBXe+g=
gitea.libretechconsulting.com/rmcguire/go-app v0.6.2 h1:vpEdZu7WI8qIil5NLf6OUF/Tk8+3txZ7fTv1NRRnOoc=
gitea.libretechconsulting.com/rmcguire/go-app v0.6.2/go.mod h1:S3/vdMEiRWWIdD0Fr+tjJc627VzxNzO4Ia2HgTBXe+g=
gitea.libretechconsulting.com/rmcguire/go-app v0.6.3 h1:dXYHJxK/1vmWBj1wqbqEUncFt3O92agy9gNWoa9NpA0=
gitea.libretechconsulting.com/rmcguire/go-app v0.6.3/go.mod h1:S3/vdMEiRWWIdD0Fr+tjJc627VzxNzO4Ia2HgTBXe+g=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA=
@ -31,21 +27,16 @@ github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.0 h1:VD1gqscl4nYs1YxVuSdemTrSgTKrwOWDK0FVFMqm+Cg=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.0/go.mod h1:4EgsQoS4TOhJizV+JTFg40qx1Ofh3XmXEQNBpgvNT40=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1 h1:KcFzXwzM/kGhIRHvc8jdixfIJjVzuUJdnv+5xsPutog=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1/go.mod h1:qOchhhIlmRcqk/O9uCo/puJlyo07YINaIqdZfZG3Jkc=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@ -66,8 +57,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk=
github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
@ -85,71 +74,53 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I=
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 h1:ajl4QczuJVA2TU9W9AGw++86Xga/RKt//16z/yxPgdk=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0/go.mod h1:Vn3/rlOJ3ntf/Q3zAI0V5lDnTbHGaUsNUeF6nZmm7pA=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
go.opentelemetry.io/otel/exporters/prometheus v0.56.0 h1:GnCIi0QyG0yy2MrJLzVrIM7laaJstj//flf1zEJCG+E=
go.opentelemetry.io/otel/exporters/prometheus v0.56.0/go.mod h1:JQcVZtbIIPM+7SWBB+T6FK+xunlyidwLp++fN0sUaOk=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0 h1:czJDQwFrMbOr9Kk+BPo1y8WZIIFIK58SA1kykuVeiOU=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0/go.mod h1:lT7bmsxOe58Tq+JIOkTQMCGXdu47oA+VJKLZHbaBKbs=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0 h1:jBpDk4HAUsrnVO1FsfCfCOTEc/MkInJmvfCHYLFiT80=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0/go.mod h1:H9LUIM1daaeZaz91vZcfeM0fejXPmgCYE8ZhzqfJuiU=
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 h1:x7wzEgXfnzJcHDwStJT+mxOz4etr2EcexjqhBvmoakw=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0/go.mod h1:rg+RlpR5dKwaS95IyyZqj5Wd4E13lk/msnTS0Xl9lJM=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 h1:QcFwRrZLc82r8wODjvyCbP7Ifp3UANaBSmhDSFjnqSc=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0/go.mod h1:CXIWhUomyWBG/oY2/r/kLp6K/cmx9e/7DLpBuuGdLCA=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo=
go.opentelemetry.io/otel/exporters/prometheus v0.57.0 h1:AHh/lAP1BHrY5gBwk8ncc25FXWm/gmmY3BX258z5nuk=
go.opentelemetry.io/otel/exporters/prometheus v0.57.0/go.mod h1:QpFWz1QxqevfjwzYdbMb4Y1NnlJvqSGwyuU0B4iuc9c=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 h1:PB3Zrjs1sG1GBX51SXyTSoOTqcDglmsk7nT6tkKPb/k=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0/go.mod h1:U2R3XyVPzn0WX7wOIypPuptulsMcPDPs/oiSVOMVnHY=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0 h1:T0Ec2E+3YZf5bgTNQVet8iTDW7oIk03tXHq+wkwIDnE=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0/go.mod h1:30v2gqH+vYGJsesLWFov8u47EpYTcIQcBjKpI6pJThg=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
google.golang.org/genproto/googleapis/api v0.0.0-20250127172529-29210b9bc287 h1:A2ni10G3UlplFrWdCDJTl7D7mJ7GSRm37S+PDimaKRw=
google.golang.org/genproto/googleapis/api v0.0.0-20250127172529-29210b9bc287/go.mod h1:iYONQfRdizDB8JJBybql13nArx91jcUk7zCXEsOofM4=
google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b h1:i+d0RZa8Hs2L/MuaOQYI+krthcxdEbEM2N+Tf3kJ4zk=
google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:iYONQfRdizDB8JJBybql13nArx91jcUk7zCXEsOofM4=
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950=
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 h1:J1H9f+LEdWAfHcez/4cvaVBox7cOYT+IU6rgqj5x++8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b h1:FQtJ1MxbXoIIrZHZ33M+w5+dAP9o86rgpjoKr/ZmT7k=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb h1:TLPQVbx1GJ8VKZxz52VAxl1EBgKXXbTiU9Fc5fZeLn4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I=
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@ -0,0 +1,6 @@
dependencies:
- name: hull
repository: https://vidispine.github.io/hull
version: 1.32.2
digest: sha256:7b73a7f152916fed9842efe4f65081b1cda0fcebd8f36d27e48136b608ce305f
generated: "2025-03-08T12:22:41.343082-05:00"

View File

@ -0,0 +1,30 @@
apiVersion: v2
name: ambient-local-exporter
description: Cloud-free metrics exporter for ambient weather stations
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.9.0"
dependencies:
- name: hull
repository: https://vidispine.github.io/hull
version: 1.32.2

Binary file not shown.

View File

@ -0,0 +1,643 @@
################################
### values.yaml for HULL
### The basic pre-configuration takes place here.
###
### Do not change this file, use additional values.hull.yaml
### to overwrite the selected fields!
################################
###################################################
### CONFIG
config:
general:
rbac: true
fullnameOverride: ""
nameOverride: ""
namespaceOverride: ""
noObjectNamePrefixes: false
createImagePullSecretsFromRegistries: true
globalImageRegistryServer: ""
globalImageRegistryToFirstRegistrySecretServer: false
serialization:
configmap:
enabled: true
fileExtensions:
json: toPrettyJson
yml: toYaml
yaml: toYaml
secret:
enabled: true
fileExtensions:
json: toPrettyJson
yml: toYaml
yaml: toYaml
render:
passes: 3
emptyLabels: false
emptyAnnotations: false
emptyTemplateLabels: false
emptyTemplateAnnotations: false
emptyHullObjects: false
postRender:
globalStringReplacements:
instanceKey:
enabled: false
string: _HULL_OBJECT_TYPE_DEFAULT_
replacement: OBJECT_INSTANCE_KEY
instanceKeyResolved:
enabled: false
string: _HULL_OBJECT_TYPE_DEFAULT_
replacement: OBJECT_INSTANCE_KEY_RESOLVED
instanceName:
enabled: false
string: _HULL_OBJECT_TYPE_DEFAULT_
replacement: OBJECT_INSTANCE_NAME
errorChecks:
objectYamlValid: true
hullGetTransformationReferenceValid: true
containerImageValid: true
virtualFolderDataPathExists: true
virtualFolderDataInlineValid: false
debug:
renderBrokenHullGetTransformationReferences: false
renderNilWhenInlineIsNil: false
renderPathMissingWhenPathIsNonExistent: false
metadata:
labels:
common:
'app.kubernetes.io/managed-by':
'app.kubernetes.io/version':
'app.kubernetes.io/part-of':
'app.kubernetes.io/name':
'app.kubernetes.io/instance':
'app.kubernetes.io/component':
'helm.sh/chart':
'vidispine.hull/version':
custom: {}
annotations:
hashes: false
custom: {}
data: {}
specific: {}
templates:
pod:
global: {}
container:
global: {}
###################################################
###################################################
### OBJECTS
objects:
# NAMESPACE
namespace:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
staticName: true
annotations: {}
labels: {}
###################################################
# CONFIGMAPS
configmap:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# SECRETS
secret:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# REGISTRIES
registry:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# SERVICEACCOUNTS
serviceaccount:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
default:
enabled: _HT?eq (dig "serviceAccountName" "" _HT*hull.config.templates.pod.global) ""
annotations: {}
labels: {}
###################################################
# ROLES
role:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_: {}
default:
enabled: _HT?eq (dig "serviceAccountName" "" _HT*hull.config.templates.pod.global) ""
rules: {}
###################################################
# ROLEBINDINGS
rolebinding:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
default:
enabled: _HT?eq (dig "serviceAccountName" "" _HT*hull.config.templates.pod.global) ""
roleRef:
apiGroup: "rbac.authorization.k8s.io"
kind: "Role"
name: _HT^default
subjects:
- kind: ServiceAccount
name: _HT^default
namespace: _HT**Release.Namespace
###################################################
# CLUSTERROLES
clusterrole:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# CLUSTERROLEBINDINGS
clusterrolebinding:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# CUSTOMRESOURCEDEFINITIONS (deprecated with Helm3)
# customresourcedefinitions:
# _HULL_OBJECT_TYPE_DEFAULT_:
# enabled: true
# annotations: {}
# labels: {}
###################################################
# CUSTOMRESOURCES
customresource:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# PERSISTENTVOLUMECLAIMS
persistentvolumeclaim:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# PERSISTENTVOLUMES
persistentvolume:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# STORAGECLASSES
storageclass:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# SERVICES
service:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
ports:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# INGRESSES
ingress:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
tls:
_HULL_OBJECT_TYPE_DEFAULT_: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_:
http:
paths:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# INGRESSCLASSES
ingressclass:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# DEPLOYMENTS
deployment:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
templateAnnotations: {}
templateLabels: {}
pod:
initContainers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
containers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumes:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# JOBS
job:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
templateAnnotations: {}
templateLabels: {}
pod:
initContainers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
containers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumes:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# CRONJOBS
cronjob:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
job:
templateAnnotations: {}
templateLabels: {}
pod:
initContainers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
containers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumes:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# DAEMONSETS
daemonset:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
templateAnnotations: {}
templateLabels: {}
pod:
initContainers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
containers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumes:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# STATEFULSETS
statefulset:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
templateAnnotations: {}
templateLabels: {}
pod:
initContainers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
containers:
_HULL_OBJECT_TYPE_DEFAULT_:
env:
_HULL_OBJECT_TYPE_DEFAULT_: {}
envFrom:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumeMounts:
_HULL_OBJECT_TYPE_DEFAULT_: {}
volumes:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# SERVICEMONITORS
servicemonitor:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# HORIZONTALPODAUTOSCALER
horizontalpodautoscaler:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# PODDISRUPTIONBUDGET
poddisruptionbudget:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# PRIORITYCLASS
priorityclass:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# ENDPOINTS
endpoints:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# ENDPOINTSLICE
endpointslice:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# LIMITRANGE
limitrange:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
###################################################
# MUTATINGWEBHOOKCONFIGURATION
mutatingwebhookconfiguration:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
webhooks:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# VALIDATINGWEBHOOKCONFIGURATION
validatingwebhookconfiguration:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
webhooks:
_HULL_OBJECT_TYPE_DEFAULT_: {}
###################################################
# RESOURCEQUOTA
resourcequota:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
##################################################
# NETWORKPOLICY
networkpolicy:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
##################################################
# GATEWAY API - BACKENDLBPOLICY
backendlbpolicy:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
targetRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - BACKENDTLSPOLICY
backendtlspolicy:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
targetRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - GATEWAYCLASS
gatewayclass:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
##################################################
# GATEWAY API - GATEWAY
gateway:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
addresses:
_HULL_OBJECT_TYPE_DEFAULT_: {}
listeners:
_HULL_OBJECT_TYPE_DEFAULT_:
tls:
certificateRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
frontendValidation:
caCertificateRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
allowedRoutes:
kinds:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - GRPCROUTE
grpcroute:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
parentRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_:
matches:
_HULL_OBJECT_TYPE_DEFAULT_: {}
filters:
_HULL_OBJECT_TYPE_DEFAULT_: {}
backendRefs:
_HULL_OBJECT_TYPE_DEFAULT_:
filters:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - REFERENCEGRANT
referencegrant:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
from:
_HULL_OBJECT_TYPE_DEFAULT_: {}
to:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - TCPROUTE
tcproute:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
parentRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_:
backendRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - TLSROUTE
tlsroute:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
parentRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_:
backendRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - UDPROUTE
udproute:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
parentRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_:
backendRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################
# GATEWAY API - HTTPROUTE
httproute:
_HULL_OBJECT_TYPE_DEFAULT_:
enabled: true
annotations: {}
labels: {}
parentRefs:
_HULL_OBJECT_TYPE_DEFAULT_: {}
rules:
_HULL_OBJECT_TYPE_DEFAULT_:
matches:
_HULL_OBJECT_TYPE_DEFAULT_: {}
filters:
_HULL_OBJECT_TYPE_DEFAULT_: {}
backendRefs:
_HULL_OBJECT_TYPE_DEFAULT_:
filters:
_HULL_OBJECT_TYPE_DEFAULT_: {}
##################################################

View File

@ -0,0 +1 @@
{{- include "hull.objects.prepare.all" (dict "HULL_ROOT_KEY" "hull" "ROOT_CONTEXT" $) }}

View File

@ -0,0 +1,217 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/vidispine/hull/refs/heads/main/hull/values.schema.json
hull:
config:
## Ambient-Local-Exporter settings (config.yaml)
appConfig:
## App Config
environment: production
name: ambient-local-exporter
logging:
level: info
format: json
output: stdout
timeFormat: rfc3339
http:
listen: :8080
logRequests: false
grpc:
enabled: true
listen: :8081
logRequests: true
enableReflection: true
enableInstrumentation: true
otel:
enabled: true
metricIntervalSecs: 30
stdoutEnabled: false
## Ambient Config
metricPrefix: weather
weatherStations:
[]
# - name: Home Weather Station
# equipment: Ambient WS-2909
# awnPassKey: D3:AD:B3:3F:00:00
# proxyToAWN: true
# proxyToWunderground: false
# keepMetrics:
# - BaromAbsoluteIn
# - BaromRelativeIn
# - HumidityIndoor
# - StationType
# - TempIndoorF
# discardMetrics: []
# - name: Shop Weather Station
# equipment: Ambient WS-5000
# awnPassKey: D3:AD:B3:3F:00:00
# wundergroundID: KINCOLUMXXX
# wundergroundPassword: somekey
# proxyToAWN: true
# proxyToWunderground: true
# keepMetrics: []
# discardMetrics: []
# sensorMappings:
# TempHumiditySensor1: Deep Freezer
## Chart settings
settings:
resources: {} # Applies to the exporter container
repo: gitea.libretechconsulting.com/rmcguire/ambient-local-exporter
tag: _HT**Chart.AppVersion
httpPort: 8080 # Should match appConfig http.listen
grpcPort: 8081 # Should match appConfig grpc.listen
# Use this as a shortcut, or create your own hull.objects.httproute
httproute:
enabled: true
hostnames:
- ambient-local-exporter.mydomain.com
gatewayName: istio-ingressgateway
gatewayNamespace: istio-system
# Use this as a shortcut, or create your own hull.objects.grpcroute
grpcroute:
enabled: true
hostnames:
- ambient-local-exporter.mydomain.com
gatewayName: istio-ingressgateway
gatewayNamespace: istio-system
otelServiceName: ambient-local-exporter
otelResourceAttributes: app=ambient-local-exporter
otlpEndpoint: http://otel.otel.svc.cluster.local:4317 # Replace me
serviceType: ClusterIP
serviceLbIP: "" # Used if serviceTyps=LoadBalancer
general:
rbac: false
render:
passes: 2
# Applies to all objects
metadata:
labels:
custom:
app: _HT**Release.Name
version: _HT**Chart.AppVersion
objects:
configmap:
config:
data:
config.yaml:
serialization: toYaml
inline: _HT*hull.config.appConfig
environment:
data:
OTEL_EXPORTER_OTLP_ENDPOINT:
serialization: none
inline: _HT*hull.config.settings.otlpEndpoint
OTEL_SERVICE_NAME:
serialization: none
inline: _HT*hull.config.settings.otelServiceName
OTEL_RESOURCE_ATTRIBUTES:
serialization: none
inline: _HT!
{{ printf "deployment.name=%s,%s" _HT**Release.Name _HT*hull.config.settings.otelResourceAttributes }}
serviceaccount:
default:
enabled: false
role:
default:
enabled: false
rolebinding:
default:
enabled: false
deployment:
main:
pod:
containers:
main:
image:
repository: _HT*hull.config.settings.repo
tag: _HT!{{ printf "v%s" _HT*hull.config.settings.tag }}
imagePullPolicy: Always
args:
- -config
- /app/config.yaml
ports:
http:
containerPort: _HT*hull.config.settings.httpPort
grpc:
containerPort: _HT*hull.config.settings.grpcPort
envFrom:
main:
configMapRef:
name: environment
resources: _HT*hull.config.settings.resources
readinessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
periodSeconds: 10
failureThreshold: 2
livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
periodSeconds: 10
failureThreshold: 2
volumeMounts:
config:
name: config
mountPath: /app/config.yaml
subPath: config.yaml
volumes:
environment:
configMap:
name: environment
config:
configMap:
name: config
service:
main:
type: _HT*hull.config.settings.serviceType
loadBalancerIP: _HT*hull.config.settings.serviceLbIP
ports:
http:
port: _HT*hull.config.settings.httpPort
targetPort: http
grpc:
port: _HT*hull.config.settings.grpcPort
targetPort: grpc
httproute:
main:
enabled: _HT*hull.config.settings.httproute.enabled
hostnames: _HT*hull.config.settings.httproute.hostnames
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: _HT*hull.config.settings.httproute.gatewayName
namespace: _HT*hull.config.settings.httproute.gatewayNamespace
rules:
- backendRefs:
- group: ""
kind: Service
name: _HT^main
port: _HT*hull.config.settings.httpPort
grpcroute:
main:
enabled: _HT*hull.config.settings.grpcroute.enabled
hostnames: _HT*hull.config.settings.grpcroute.hostnames
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: _HT*hull.config.settings.grpcroute.gatewayName
namespace: _HT*hull.config.settings.grpcroute.gatewayNamespace
rules:
- backendRefs:
- group: ""
kind: Service
name: _HT^main
port: _HT*hull.config.settings.grpcPort

86
main.go
View File

@ -6,38 +6,60 @@ import (
"os/signal"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/app"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv"
grpcopts "gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/grpc/opts"
httpopts "gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/http/opts"
"golang.org/x/sys/unix"
"k8s.io/utils/ptr"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient/ambienthttp"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient/config"
weatherpb "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient/ambienthttp"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient/config"
weathergrpc "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather/grpc"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather/state"
)
const defaultMetricPrefix = "weather"
const (
defaultMetricPrefix = "weather"
defaultUpdatesToKeep = 120
)
func main() {
ctx, cncl := signal.NotifyContext(context.Background(), os.Kill, unix.SIGTERM)
ctx, cncl := signal.NotifyContext(context.Background(), os.Kill, os.Interrupt, unix.SIGTERM)
defer cncl()
// Config type for app, which implements go-app/config.AppConfig
awConfig := &config.AmbientLocalExporterConfig{
// Read config and environment, prepare an appCtx, and merge
// go-app config into ambient weather exporter app config
ctx, awConfig := app.MustLoadConfigInto(ctx, &config.AmbientLocalExporterConfig{
MetricPrefix: defaultMetricPrefix,
WeatherStations: make([]config.WeatherStation, 0),
}
})
// Read config and environment, set up logging, load up
// an appCtx, and prepare ambient weather local exporter
ctx, awConfig = app.MustLoadConfigInto(ctx, awConfig)
// Prepare the exporter
// Prepare the ambient exporter with our prepared config
// and set up logging, tracing, etc..
aw := ambient.New(ctx, awConfig).Init()
// Define and prepare the app
awApp := app.App{
// Load http and grpc routes, prepare the app
awApp := prepareApp(ctx, aw)
// Run app and wait
awApp.MustRun()
<-awApp.Done()
}
func prepareApp(ctx context.Context, aw *ambient.AmbientWeather) *app.App {
// Config updates / defaults
if aw.Config.UpdatesToKeep == nil || *aw.Config.UpdatesToKeep < 1 {
aw.Config.UpdatesToKeep = ptr.To(defaultUpdatesToKeep)
}
// Load ambient routes into app
awApp := &app.App{
AppContext: ctx,
HTTP: &app.AppHTTP{
Funcs: []srv.HTTPFunc{
// HTTP Endpoints for Ambient Weather Stations
HTTP: &httpopts.AppHTTP{
Funcs: []httpopts.HTTPFunc{
{
Path: "/weatherstation/updateweatherstation.php",
HandlerFunc: aw.GetWundergroundHandlerFunc(ctx),
@ -47,18 +69,36 @@ func main() {
HandlerFunc: aw.GetAWNHandlerFunc(ctx),
},
},
// HTTP Listener that fixes broken requests generated by
// some versions of awn firmware
CustomListener: ambienthttp.NewAWNMutatingListener(ctx,
awConfig.HTTP.Listen), // Necessary to fix certain bad AWN firmware
HealthChecks: []srv.HealthCheckFunc{
aw.Config.HTTP.Listen), // Necessary to fix certain bad AWN firmware
// Health check funcs
HealthChecks: []httpopts.HealthCheckFunc{
// TODO: Implement
func(ctx context.Context) error {
return nil
},
},
},
// GRPC Service for retrieving weather
GRPC: &grpcopts.AppGRPC{
Services: []*grpcopts.GRPCService{
{
Name: "Weather Service",
Type: &weatherpb.AmbientLocalWeatherService_ServiceDesc,
Service: weathergrpc.NewGRPCWeather(ctx, state.NewWeatherState(
&state.Opts{
Ctx: ctx,
KeepLast: *aw.Config.UpdatesToKeep,
})),
},
},
},
}
// Run and wait
awApp.MustRun()
<-awApp.Done()
return awApp
}

View File

@ -15,11 +15,11 @@ import (
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient/config"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/provider"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/provider/awn"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/provider/wunderground"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient/config"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/provider"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/provider/awn"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/provider/wunderground"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
type AmbientWeather struct {
@ -27,7 +27,7 @@ type AmbientWeather struct {
// when either "AmbientWeather" or "Wunderground" are selected
// in the "Custom" section of the AWNet app, or the web UI
// of an Ambient WeatherHub
config *config.AmbientLocalExporterConfig
Config *config.AmbientLocalExporterConfig
awnProvider provider.AmbientProvider
wuProvider provider.AmbientProvider
appCtx context.Context
@ -37,7 +37,7 @@ type AmbientWeather struct {
func New(appCtx context.Context, awConfig *config.AmbientLocalExporterConfig) *AmbientWeather {
return &AmbientWeather{
config: awConfig,
Config: awConfig,
appCtx: appCtx,
}
}
@ -48,7 +48,7 @@ func (aw *AmbientWeather) Init() *AmbientWeather {
aw.wuProvider = &wunderground.WUProvider{}
aw.l = zerolog.Ctx(aw.appCtx)
aw.l.Trace().Any("awConfig", aw.config).Send()
aw.l.Trace().Any("awConfig", aw.Config).Send()
return aw
}
@ -81,9 +81,9 @@ func (aw *AmbientWeather) handleProviderRequest(
l := zerolog.Ctx(aw.appCtx)
tracer := otel.GetTracer(aw.appCtx, p.Name()+".http.handler")
ctx, span := tracer.Start(r.Context(), p.Name()+".update")
span.SetAttributes(attribute.String("provider", p.Name()))
defer span.End()
ctx, updateSpan := tracer.Start(r.Context(), p.Name()+".update")
updateSpan.SetAttributes(attribute.String("provider", p.Name()))
defer updateSpan.End()
l.Trace().Str("p", p.Name()).
Any("query", r.URL.Query()).Send()
@ -92,8 +92,8 @@ func (aw *AmbientWeather) handleProviderRequest(
update, err := p.ReqToWeather(ctx, r)
if err != nil {
l.Err(err).Send()
span.RecordError(err)
span.SetStatus(codes.Error,
updateSpan.RecordError(err)
updateSpan.SetStatus(codes.Error,
fmt.Sprintf("failed to handle %s update: %s",
p.Name(), err.Error()))
@ -105,14 +105,13 @@ func (aw *AmbientWeather) handleProviderRequest(
// Perform enrichment
aw.enrichUpdate(ctx, p, update)
// Update metrics
ctx, updateSpan := tracer.Start(ctx, p.Name()+".update.metrics")
if aw.metrics == nil {
aw.InitMetrics()
// We may know which station this was for now
if update.StationConfig != nil {
updateSpan.SetAttributes(attribute.String("stationName", update.StationConfig.Name))
}
aw.metrics.Update(update)
updateSpan.SetStatus(codes.Ok, "")
updateSpan.End()
// Update metrics
aw.metricsUpdate(ctx, p, update)
l.Debug().
Str("provider", p.Name()).
@ -137,7 +136,10 @@ func (aw *AmbientWeather) enrichUpdate(
// Calculate any fields that may be missing
// such as dew point and wind chill
ctx, enrichSpan := tracer.Start(ctx, p.Name()+".update.enrich")
_, enrichSpan := tracer.Start(ctx, p.Name()+".update.enrich")
defer enrichSpan.End()
// Metric enrichment
update.Enrich()
// Enrich station if configured
@ -147,7 +149,24 @@ func (aw *AmbientWeather) enrichUpdate(
update.MapSensors()
enrichSpan.SetStatus(codes.Ok, "")
enrichSpan.End()
}
func (aw *AmbientWeather) metricsUpdate(
ctx context.Context,
p provider.AmbientProvider,
update *weather.WeatherUpdate,
) {
tracer := otel.GetTracer(aw.appCtx, p.Name()+".http.handler")
_, metricsSpan := tracer.Start(ctx, p.Name()+".update.metrics")
if aw.metrics == nil {
aw.InitMetrics()
}
aw.metrics.Update(update)
metricsSpan.SetStatus(codes.Ok, "")
metricsSpan.End()
}
func (aw *AmbientWeather) proxyUpdate(
@ -208,15 +227,15 @@ func (aw *AmbientWeather) proxyUpdate(
}
func (aw *AmbientWeather) InitMetrics() {
if aw.config.MetricPrefix != "" {
weather.MetricPrefix = aw.config.MetricPrefix
if aw.Config.MetricPrefix != "" {
weather.MetricPrefix = aw.Config.MetricPrefix
}
aw.metrics = weather.MustInitMetrics(aw.appCtx)
}
func (aw *AmbientWeather) enrichStation(update *weather.WeatherUpdate) {
if update != nil && update.StationID != nil && *update.StationID != "" {
for _, station := range aw.config.WeatherStations {
for _, station := range aw.Config.WeatherStations {
if *update.StationID == station.AWNPassKey || *update.StationID == station.WundergroundID {
update.StationConfig = &station
}

View File

@ -7,7 +7,8 @@ import (
// This configuration includes all config from go-app/config.AppConfig
type AmbientLocalExporterConfig struct {
MetricPrefix string `yaml:"metricPrefix" default:"weather" env:"AMBIENT_METRIC_PREFIX"`
WeatherStations []WeatherStation `yaml:"weatherStations"` // No env, too complex, not worth the time
UpdatesToKeep *int `yaml:"updatesToKeep" default:"1" env:"AMBIENT_UPDATES_TO_KEEP"`
WeatherStations []WeatherStation `yaml:"weatherStations" env:"weatherStations"` // No env, too complex, not worth the time
*config.AppConfig // Extends app config
}

View File

@ -8,7 +8,7 @@ import (
"github.com/gorilla/schema"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
type AWNProvider struct{}

View File

@ -12,7 +12,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
// Attempts to proxy the weather station update to awn

View File

@ -4,7 +4,7 @@ import (
"context"
"net/http"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
// Simple interface used for converting Wunderground and

View File

@ -8,7 +8,7 @@ import (
"github.com/gorilla/schema"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
type WUProvider struct{}

View File

@ -13,7 +13,7 @@ import (
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/otel"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
func (wu *WUProvider) ProxyReq(ctx context.Context, update *weather.WeatherUpdate) error {

View File

@ -5,7 +5,7 @@ import (
"net/url"
"strconv"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient/config"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient/config"
)
// Attempts to complete missing fields that may not

View File

@ -0,0 +1,85 @@
package grpc
import (
"k8s.io/utils/ptr"
pb "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
func UpdatesToPbUpdates(u []*weather.WeatherUpdate) []*pb.WeatherUpdate {
updates := make([]*pb.WeatherUpdate, len(u))
for i, update := range u {
updates[i] = UpdateToPbUpdate(update)
}
return updates
}
func UpdateToPbUpdate(u *weather.WeatherUpdate) *pb.WeatherUpdate {
return &pb.WeatherUpdate{
StationName: u.StationConfig.Name,
StationType: derefStr(u.StationType),
StationId: derefStr(u.StationID),
TempOutdoorF: u.TempOutdoorF,
TempIndoorF: u.TempIndoorF,
HumidityOutdoor: int32ptr(u.HumidityOudoor),
HumidityIndoor: int32ptr(u.HumidityIndoor),
WindSpeedMph: u.WindSpeedMPH,
WindGustMph: u.WindGustMPH,
MaxDailyGust: u.MaxDailyGust,
WindDir: int32ptr(u.WindDir),
WindDirAvg_10M: int32ptr(u.WindDirAvg10m),
Uv: int32ptr(u.UV),
SolarRadiation: u.SolarRadiation,
HourlyRainIn: u.HourlyRainIn,
EventRainIn: u.EventRainIn,
DailyRainIn: u.DailyRainIn,
WeeklyRainIn: u.WeeklyRainIn,
MonthlyRainIn: u.MonthlyRainIn,
YearlyRainIn: u.YearlyRainIn,
TotalRainIn: u.TotalRainIn,
Batteries: batteriesToPbBatteries(u.Batteries),
BaromRelativeIn: u.BaromRelativeIn,
BaromAbsoluteIn: u.BaromAbsoluteIn,
DewPointF: u.DewPointF,
WindChillF: u.WindChillF,
TempHumiditySensors: thSensorsToPbSensors(u.TempHumiditySensors),
}
}
func batteriesToPbBatteries(batteries []weather.BatteryStatus) []*pb.BatteryStatus {
pbBatteries := make([]*pb.BatteryStatus, len(batteries))
for i, b := range batteries {
pbBatteries[i] = &pb.BatteryStatus{
Component: b.Component,
Status: int32ptr(b.Status),
}
}
return pbBatteries
}
func thSensorsToPbSensors(sensors []*weather.TempHumiditySensor) []*pb.TempHumiditySensor {
pbSensors := make([]*pb.TempHumiditySensor, len(sensors))
for i, s := range sensors {
pbSensors[i] = &pb.TempHumiditySensor{
Name: s.Name,
TempF: s.TempF,
Humidity: int32ptr(s.Humidity),
}
}
return pbSensors
}
func derefStr(s *string) string {
if s == nil {
return ""
}
return *s
}
func int32ptr(i *int) *int32 {
if i == nil {
return nil
}
return ptr.To(int32(*i))
}

View File

@ -0,0 +1,66 @@
package grpc
import (
"context"
"go.opentelemetry.io/otel/attribute"
otelcodes "go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/otel"
pb "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather/state"
)
type GRPCWeather struct {
ctx context.Context
state *state.WeatherState
tracer trace.Tracer
*pb.UnimplementedAmbientLocalWeatherServiceServer
}
func NewGRPCWeather(ctx context.Context, state *state.WeatherState) *GRPCWeather {
return &GRPCWeather{
ctx: ctx,
state: state,
tracer: otel.GetTracer(ctx, "grpcWeather"),
}
}
func (w *GRPCWeather) GetWeather(ctx context.Context, req *pb.GetWeatherRequest) (
*pb.GetWeatherResponse, error,
) {
ctx, span := w.tracer.Start(ctx, "getWeather")
defer span.End()
limit := 1
if req.Limit != nil {
if *req.Limit > 1 {
limit = int(*req.Limit)
}
}
span.SetAttributes(attribute.Int("limit", limit))
updates, err := w.state.Get(ctx, limit)
if err != nil {
span.RecordError(err)
span.SetStatus(otelcodes.Error, err.Error())
return nil, status.Errorf(codes.Internal, err.Error())
} else if len(updates) < 1 {
return nil, status.Errorf(codes.OutOfRange, "no weather available")
}
span.SetStatus(otelcodes.Ok, "")
return &pb.GetWeatherResponse{
LastUpdated: &timestamppb.Timestamp{
Seconds: updates[0].DateUTC.Unix(),
},
WeatherUpdates: UpdatesToPbUpdates(updates),
}, nil
}

View File

@ -8,7 +8,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient/config"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient/config"
)
type MetricRecorder struct {

View File

@ -0,0 +1,41 @@
package state
import (
"context"
"sync"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/trace"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/otel"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
type WeatherState struct {
updates []*weather.WeatherUpdate
keep int
ctx context.Context
tracer trace.Tracer
meter metric.Meter
*sync.RWMutex
}
type Opts struct {
Ctx context.Context
KeepLast int
}
func NewWeatherState(opts *Opts) *WeatherState {
if opts.KeepLast < 1 {
opts.KeepLast = 1
}
return &WeatherState{
updates: make([]*weather.WeatherUpdate, 0),
keep: opts.KeepLast,
ctx: opts.Ctx,
tracer: otel.GetTracer(opts.Ctx, "weatherState"),
meter: otel.GetMeter(opts.Ctx, "weatherState"),
}
}

View File

@ -0,0 +1,87 @@
package state
import (
"context"
"errors"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
// Returns last requested number of weather updates
func (w *WeatherState) Get(ctx context.Context, last int) (
[]*weather.WeatherUpdate, error,
) {
if last < 1 {
last = 1
}
ctx, span := w.tracer.Start(ctx, "getWeatherState")
span.SetAttributes(
attribute.Int("last", last),
attribute.Int("keep", w.keep),
attribute.Int("currentSize", w.Count()),
)
defer span.End()
updates, err := w.get(ctx, last)
if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
} else {
span.SetStatus(codes.Ok, "")
}
return updates, err
}
func (w *WeatherState) get(ctx context.Context, last int) (
[]*weather.WeatherUpdate, error,
) {
span := trace.SpanFromContext(ctx)
w.RLock()
defer w.Unlock()
span.AddEvent("acquired lock on state cache")
updates := w.updates
if w.count() == 0 {
err := errors.New("no state to get")
span.RecordError(err)
return nil, err
} else if w.count() <= last {
span.RecordError(errors.New("requested more state than exists"))
} else {
updates = updates[len(updates)-last:]
}
span.SetAttributes(attribute.Int("retrieved", len(updates)))
span.SetStatus(codes.Ok, "")
return updates, nil
}
// Returns count of retained weather updates
func (w *WeatherState) Count() int {
_, span := w.tracer.Start(w.ctx, "countWeatherState")
defer span.End()
count := w.count()
span.SetAttributes(attribute.Int("count", count))
span.SetStatus(codes.Ok, "")
return count
}
func (w *WeatherState) count() int {
w.RLock()
defer w.RUnlock()
return len(w.updates)
}

View File

@ -0,0 +1,35 @@
package state
import (
"context"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
)
func (w *WeatherState) Set(ctx context.Context, u *weather.WeatherUpdate) error {
_, span := w.tracer.Start(ctx, "setWeatherState")
span.SetAttributes(
attribute.Int("countWeatherUpdates", w.Count()),
attribute.Int("keepUpdates", w.keep),
)
defer span.End()
return w.set(span, u)
}
func (w *WeatherState) set(span trace.Span, u *weather.WeatherUpdate) error {
w.Lock()
defer w.Unlock()
if len(w.updates) > w.keep {
w.updates = w.updates[1:]
span.AddEvent("trimmed state updates by 1")
}
w.updates = append(w.updates, u)
span.AddEvent("recorded weather state")
return nil
}

View File

@ -3,7 +3,7 @@ package weather
import (
"time"
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient/config"
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/ambient/config"
)
// Stable intermediate struct containing superset of fields

View File

@ -0,0 +1,64 @@
syntax = "proto3";
package ambient.weather;
import "google/protobuf/timestamp.proto";
option go_package = "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather";
message GetWeatherRequest {
GetWeatherOpts opts = 1;
optional int32 limit = 2;
}
message GetWeatherResponse{
google.protobuf.Timestamp last_updated = 1;
repeated WeatherUpdate weather_updates = 2;
}
message GetWeatherOpts {
optional string station_name = 1;
optional string station_type = 2;
}
message WeatherUpdate {
string station_name = 1;
string station_type = 2;
string station_id = 3;
optional double temp_outdoor_f = 4;
optional double temp_indoor_f = 5;
optional int32 humidity_outdoor = 6;
optional int32 humidity_indoor = 7;
optional double wind_speed_mph = 8;
optional double wind_gust_mph = 9;
optional double max_daily_gust = 10;
optional int32 wind_dir = 11;
optional int32 wind_dir_avg_10m = 12;
optional int32 uv = 13;
optional double solar_radiation = 14;
optional double hourly_rain_in = 15;
optional double event_rain_in = 16;
optional double daily_rain_in = 17;
optional double weekly_rain_in = 18;
optional double monthly_rain_in = 19;
optional double yearly_rain_in = 20;
optional double total_rain_in = 21;
repeated BatteryStatus batteries = 22;
optional double barom_relative_in = 23;
optional double barom_absolute_in = 24;
optional double dew_point_f = 25;
optional double wind_chill_f = 26;
repeated TempHumiditySensor temp_humidity_sensors = 27;
}
// Represents a temperature and humidity sensor
message TempHumiditySensor {
string name = 1;
optional double temp_f = 2;
optional int32 humidity = 3;
}
// Represents battery status for different components
message BatteryStatus {
string component = 1;
optional int32 status = 2;
}

View File

@ -0,0 +1,10 @@
syntax = "proto3";
package ambient.weather;
import "weather/weather.proto";
option go_package = "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather";
service AmbientLocalWeatherService {
rpc GetWeather(GetWeatherRequest) returns (GetWeatherResponse);
}