window.pb.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.36.9
  4. // protoc v6.32.1
  5. // source: model/window.proto
  6. package pb
  7. import (
  8. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  9. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  10. timestamppb "google.golang.org/protobuf/types/known/timestamppb"
  11. reflect "reflect"
  12. sync "sync"
  13. unsafe "unsafe"
  14. )
  15. const (
  16. // Verify that this generated code is sufficiently up-to-date.
  17. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  18. // Verify that runtime/protoimpl is sufficiently up-to-date.
  19. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  20. )
  21. // Resolution represents the time granularity for data aggregation
  22. type Resolution int32
  23. const (
  24. Resolution_RESOLUTION_10M Resolution = 0 // 10 minutes
  25. Resolution_RESOLUTION_1H Resolution = 1 // 1 hour
  26. Resolution_RESOLUTION_1D Resolution = 2 // 1 day
  27. )
  28. // Enum value maps for Resolution.
  29. var (
  30. Resolution_name = map[int32]string{
  31. 0: "RESOLUTION_10M",
  32. 1: "RESOLUTION_1H",
  33. 2: "RESOLUTION_1D",
  34. }
  35. Resolution_value = map[string]int32{
  36. "RESOLUTION_10M": 0,
  37. "RESOLUTION_1H": 1,
  38. "RESOLUTION_1D": 2,
  39. }
  40. )
  41. func (x Resolution) Enum() *Resolution {
  42. p := new(Resolution)
  43. *p = x
  44. return p
  45. }
  46. func (x Resolution) String() string {
  47. return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
  48. }
  49. func (Resolution) Descriptor() protoreflect.EnumDescriptor {
  50. return file_model_window_proto_enumTypes[0].Descriptor()
  51. }
  52. func (Resolution) Type() protoreflect.EnumType {
  53. return &file_model_window_proto_enumTypes[0]
  54. }
  55. func (x Resolution) Number() protoreflect.EnumNumber {
  56. return protoreflect.EnumNumber(x)
  57. }
  58. // Deprecated: Use Resolution.Descriptor instead.
  59. func (Resolution) EnumDescriptor() ([]byte, []int) {
  60. return file_model_window_proto_rawDescGZIP(), []int{0}
  61. }
  62. // Window defines a unit of time by a resolution and a start time
  63. type Window struct {
  64. state protoimpl.MessageState `protogen:"open.v1"`
  65. // resolution defines the time granularity
  66. Resolution Resolution `protobuf:"varint,1,opt,name=resolution,proto3,enum=model.Resolution" json:"resolution,omitempty"`
  67. // the start time of the window described
  68. Start *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"`
  69. unknownFields protoimpl.UnknownFields
  70. sizeCache protoimpl.SizeCache
  71. }
  72. func (x *Window) Reset() {
  73. *x = Window{}
  74. mi := &file_model_window_proto_msgTypes[0]
  75. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  76. ms.StoreMessageInfo(mi)
  77. }
  78. func (x *Window) String() string {
  79. return protoimpl.X.MessageStringOf(x)
  80. }
  81. func (*Window) ProtoMessage() {}
  82. func (x *Window) ProtoReflect() protoreflect.Message {
  83. mi := &file_model_window_proto_msgTypes[0]
  84. if x != nil {
  85. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  86. if ms.LoadMessageInfo() == nil {
  87. ms.StoreMessageInfo(mi)
  88. }
  89. return ms
  90. }
  91. return mi.MessageOf(x)
  92. }
  93. // Deprecated: Use Window.ProtoReflect.Descriptor instead.
  94. func (*Window) Descriptor() ([]byte, []int) {
  95. return file_model_window_proto_rawDescGZIP(), []int{0}
  96. }
  97. func (x *Window) GetResolution() Resolution {
  98. if x != nil {
  99. return x.Resolution
  100. }
  101. return Resolution_RESOLUTION_10M
  102. }
  103. func (x *Window) GetStart() *timestamppb.Timestamp {
  104. if x != nil {
  105. return x.Start
  106. }
  107. return nil
  108. }
  109. var File_model_window_proto protoreflect.FileDescriptor
  110. const file_model_window_proto_rawDesc = "" +
  111. "\n" +
  112. "\x12model/window.proto\x12\x05model\x1a\x1fgoogle/protobuf/timestamp.proto\"m\n" +
  113. "\x06Window\x121\n" +
  114. "\n" +
  115. "resolution\x18\x01 \x01(\x0e2\x11.model.ResolutionR\n" +
  116. "resolution\x120\n" +
  117. "\x05start\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x05start*F\n" +
  118. "\n" +
  119. "Resolution\x12\x12\n" +
  120. "\x0eRESOLUTION_10M\x10\x00\x12\x11\n" +
  121. "\rRESOLUTION_1H\x10\x01\x12\x11\n" +
  122. "\rRESOLUTION_1D\x10\x02B0Z.github.com/opencost/opencost/core/pkg/model/pbb\x06proto3"
  123. var (
  124. file_model_window_proto_rawDescOnce sync.Once
  125. file_model_window_proto_rawDescData []byte
  126. )
  127. func file_model_window_proto_rawDescGZIP() []byte {
  128. file_model_window_proto_rawDescOnce.Do(func() {
  129. file_model_window_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_model_window_proto_rawDesc), len(file_model_window_proto_rawDesc)))
  130. })
  131. return file_model_window_proto_rawDescData
  132. }
  133. var file_model_window_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
  134. var file_model_window_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
  135. var file_model_window_proto_goTypes = []any{
  136. (Resolution)(0), // 0: model.Resolution
  137. (*Window)(nil), // 1: model.Window
  138. (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
  139. }
  140. var file_model_window_proto_depIdxs = []int32{
  141. 0, // 0: model.Window.resolution:type_name -> model.Resolution
  142. 2, // 1: model.Window.start:type_name -> google.protobuf.Timestamp
  143. 2, // [2:2] is the sub-list for method output_type
  144. 2, // [2:2] is the sub-list for method input_type
  145. 2, // [2:2] is the sub-list for extension type_name
  146. 2, // [2:2] is the sub-list for extension extendee
  147. 0, // [0:2] is the sub-list for field type_name
  148. }
  149. func init() { file_model_window_proto_init() }
  150. func file_model_window_proto_init() {
  151. if File_model_window_proto != nil {
  152. return
  153. }
  154. type x struct{}
  155. out := protoimpl.TypeBuilder{
  156. File: protoimpl.DescBuilder{
  157. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  158. RawDescriptor: unsafe.Slice(unsafe.StringData(file_model_window_proto_rawDesc), len(file_model_window_proto_rawDesc)),
  159. NumEnums: 1,
  160. NumMessages: 1,
  161. NumExtensions: 0,
  162. NumServices: 0,
  163. },
  164. GoTypes: file_model_window_proto_goTypes,
  165. DependencyIndexes: file_model_window_proto_depIdxs,
  166. EnumInfos: file_model_window_proto_enumTypes,
  167. MessageInfos: file_model_window_proto_msgTypes,
  168. }.Build()
  169. File_model_window_proto = out.File
  170. file_model_window_proto_goTypes = nil
  171. file_model_window_proto_depIdxs = nil
  172. }