implement lightning_time in grpc
This commit is contained in:
@ -5,8 +5,10 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
"k8s.io/utils/ptr"
|
||||
|
||||
pb "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather"
|
||||
@ -29,6 +31,13 @@ func Int32ptr(i *int) *int32 {
|
||||
return ptr.To(int32(*i))
|
||||
}
|
||||
|
||||
func TimestampFromIntPtr(i *int) *timestamppb.Timestamp {
|
||||
if i == nil {
|
||||
return nil
|
||||
}
|
||||
return timestamppb.New(time.Unix(int64(*i), 0))
|
||||
}
|
||||
|
||||
// Generates a hash that will be consistent
|
||||
// across all running replicas
|
||||
func GetAppHash(conf *config.AppConfig) string {
|
||||
|
Reference in New Issue
Block a user