diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..3eaa68381 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/datacommonsorg/import + +go 1.22.3 + +require google.golang.org/protobuf v1.36.6 diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..4665b5a0f --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= diff --git a/pipeline/model/src/main/proto/storage.pb.go b/pipeline/model/src/main/proto/storage.pb.go new file mode 100644 index 000000000..76c05aad9 --- /dev/null +++ b/pipeline/model/src/main/proto/storage.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v5.29.3 +// source: pipeline/model/src/main/proto/storage.proto + +package storage + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// Observations represent the observations (time series) stored in the observations column in the Observation table. +type Observations struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Map from date to value. + // Examples: "2024" -> "123", "2025-05" -> "-456.78" + Values map[string]string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Observations) Reset() { + *x = Observations{} + mi := &file_pipeline_model_src_main_proto_storage_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Observations) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Observations) ProtoMessage() {} + +func (x *Observations) ProtoReflect() protoreflect.Message { + mi := &file_pipeline_model_src_main_proto_storage_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 Observations.ProtoReflect.Descriptor instead. +func (*Observations) Descriptor() ([]byte, []int) { + return file_pipeline_model_src_main_proto_storage_proto_rawDescGZIP(), []int{0} +} + +func (x *Observations) GetValues() map[string]string { + if x != nil { + return x.Values + } + return nil +} + +var File_pipeline_model_src_main_proto_storage_proto protoreflect.FileDescriptor + +const file_pipeline_model_src_main_proto_storage_proto_rawDesc = "" + + "\n" + + "+pipeline/model/src/main/proto/storage.proto\x12\x15org.datacommons.proto\"\x92\x01\n" + + "\fObservations\x12G\n" + + "\x06values\x18\x01 \x03(\v2/.org.datacommons.proto.Observations.ValuesEntryR\x06values\x1a9\n" + + "\vValuesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01BHZFgithub.com/datacommonsorg/import/pipeline/model/src/main/proto/storageb\x06proto3" + +var ( + file_pipeline_model_src_main_proto_storage_proto_rawDescOnce sync.Once + file_pipeline_model_src_main_proto_storage_proto_rawDescData []byte +) + +func file_pipeline_model_src_main_proto_storage_proto_rawDescGZIP() []byte { + file_pipeline_model_src_main_proto_storage_proto_rawDescOnce.Do(func() { + file_pipeline_model_src_main_proto_storage_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pipeline_model_src_main_proto_storage_proto_rawDesc), len(file_pipeline_model_src_main_proto_storage_proto_rawDesc))) + }) + return file_pipeline_model_src_main_proto_storage_proto_rawDescData +} + +var file_pipeline_model_src_main_proto_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_pipeline_model_src_main_proto_storage_proto_goTypes = []any{ + (*Observations)(nil), // 0: org.datacommons.proto.Observations + nil, // 1: org.datacommons.proto.Observations.ValuesEntry +} +var file_pipeline_model_src_main_proto_storage_proto_depIdxs = []int32{ + 1, // 0: org.datacommons.proto.Observations.values:type_name -> org.datacommons.proto.Observations.ValuesEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_pipeline_model_src_main_proto_storage_proto_init() } +func file_pipeline_model_src_main_proto_storage_proto_init() { + if File_pipeline_model_src_main_proto_storage_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_pipeline_model_src_main_proto_storage_proto_rawDesc), len(file_pipeline_model_src_main_proto_storage_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pipeline_model_src_main_proto_storage_proto_goTypes, + DependencyIndexes: file_pipeline_model_src_main_proto_storage_proto_depIdxs, + MessageInfos: file_pipeline_model_src_main_proto_storage_proto_msgTypes, + }.Build() + File_pipeline_model_src_main_proto_storage_proto = out.File + file_pipeline_model_src_main_proto_storage_proto_goTypes = nil + file_pipeline_model_src_main_proto_storage_proto_depIdxs = nil +} diff --git a/pipeline/model/src/main/proto/storage.proto b/pipeline/model/src/main/proto/storage.proto index f6a4db086..b2fae2670 100644 --- a/pipeline/model/src/main/proto/storage.proto +++ b/pipeline/model/src/main/proto/storage.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package org.datacommons.proto; +option go_package = "github.com/datacommonsorg/import/pipeline/model/src/main/proto/storage"; + // Includes protos that are used in spanner storage. // The protos are typically gzipped and stored in a bytes column.