github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/metric_descriptor/metric_descriptor.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: MetricDescriptor 3 // DO NOT EDIT!!! 4 5 package metric_descriptor 6 7 import ( 8 gotenresource "github.com/cloudwan/goten-sdk/runtime/resource" 9 ) 10 11 // proto imports 12 import ( 13 api "github.com/cloudwan/edgelq-sdk/common/api" 14 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 15 monitored_resource_descriptor "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/monitored_resource_descriptor" 16 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/project" 17 meta "github.com/cloudwan/goten-sdk/types/meta" 18 durationpb "google.golang.org/protobuf/types/known/durationpb" 19 ) 20 21 // ensure the imports are used 22 var ( 23 _ = new(gotenresource.ListQuery) 24 ) 25 26 // make sure we're using proto imports 27 var ( 28 _ = api.LaunchStage(0) 29 _ = &common.LabelDescriptor{} 30 _ = &monitored_resource_descriptor.MonitoredResourceDescriptor{} 31 _ = &project.Project{} 32 _ = &durationpb.Duration{} 33 _ = &meta.Meta{} 34 ) 35 36 type MetricDescriptorList []*MetricDescriptor 37 38 func (l MetricDescriptorList) Append(item gotenresource.Resource) gotenresource.ResourceList { 39 return append(l, item.(*MetricDescriptor)) 40 } 41 42 func (l MetricDescriptorList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 43 return append(l, list.(MetricDescriptorList)...) 44 } 45 46 func (l MetricDescriptorList) Slice(first, second int) gotenresource.ResourceList { 47 if first > 0 && second > 0 { 48 return l[first:second] 49 } else if first > 0 { 50 return l[first:] 51 } else if second > 0 { 52 return l[:second] 53 } 54 return l[:] 55 } 56 57 func (l MetricDescriptorList) At(idx int) gotenresource.Resource { 58 return l[idx] 59 } 60 61 func (l MetricDescriptorList) Set(idx int, res gotenresource.Resource) { 62 l[idx] = res.(*MetricDescriptor) 63 } 64 65 func (l MetricDescriptorList) Length() int { 66 return len(l) 67 } 68 69 type MetricDescriptorChangeList []*MetricDescriptorChange 70 71 func (l MetricDescriptorChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList { 72 return append(l, item.(*MetricDescriptorChange)) 73 } 74 75 func (l MetricDescriptorChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList { 76 return append(l, list.(MetricDescriptorChangeList)...) 77 } 78 79 func (l MetricDescriptorChangeList) Slice(first, second int) gotenresource.ResourceChangeList { 80 if first > 0 && second > 0 { 81 return l[first:second] 82 } else if first > 0 { 83 return l[first:] 84 } else if second > 0 { 85 return l[:second] 86 } 87 return l[:] 88 } 89 90 func (l MetricDescriptorChangeList) At(idx int) gotenresource.ResourceChange { 91 return l[idx] 92 } 93 94 func (l MetricDescriptorChangeList) Set(idx int, change gotenresource.ResourceChange) { 95 l[idx] = change.(*MetricDescriptorChange) 96 } 97 98 func (l MetricDescriptorChangeList) Length() int { 99 return len(l) 100 } 101 102 type MetricDescriptorNameList []*Name 103 104 func (l MetricDescriptorNameList) Append(name gotenresource.Name) gotenresource.NameList { 105 return append(l, name.(*Name)) 106 } 107 108 func (l MetricDescriptorNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 109 return append(l, list.(MetricDescriptorNameList)...) 110 } 111 112 func (l MetricDescriptorNameList) Slice(first, second int) gotenresource.NameList { 113 if first > 0 && second > 0 { 114 return l[first:second] 115 } else if first > 0 { 116 return l[first:] 117 } else if second > 0 { 118 return l[:second] 119 } 120 return l[:] 121 } 122 123 func (l MetricDescriptorNameList) At(idx int) gotenresource.Name { 124 return l[idx] 125 } 126 127 func (l MetricDescriptorNameList) Set(idx int, name gotenresource.Name) { 128 l[idx] = name.(*Name) 129 } 130 131 func (l MetricDescriptorNameList) Length() int { 132 return len(l) 133 } 134 135 type MetricDescriptorReferenceList []*Reference 136 137 func (l MetricDescriptorReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 138 return append(l, ref.(*Reference)) 139 } 140 141 func (l MetricDescriptorReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 142 return append(l, list.(MetricDescriptorReferenceList)...) 143 } 144 145 func (l MetricDescriptorReferenceList) Slice(first, second int) gotenresource.ReferenceList { 146 if first > 0 && second > 0 { 147 return l[first:second] 148 } else if first > 0 { 149 return l[first:] 150 } else if second > 0 { 151 return l[:second] 152 } 153 return l[:] 154 } 155 156 func (l MetricDescriptorReferenceList) At(idx int) gotenresource.Reference { 157 return l[idx] 158 } 159 160 func (l MetricDescriptorReferenceList) Set(idx int, ref gotenresource.Reference) { 161 l[idx] = ref.(*Reference) 162 } 163 164 func (l MetricDescriptorReferenceList) Length() int { 165 return len(l) 166 } 167 168 type MetricDescriptorParentNameList []*ParentName 169 170 func (l MetricDescriptorParentNameList) Append(name gotenresource.Name) gotenresource.ParentNameList { 171 return append(l, name.(*ParentName)) 172 } 173 174 func (l MetricDescriptorParentNameList) AppendList(list gotenresource.ParentNameList) gotenresource.ParentNameList { 175 return append(l, list.(MetricDescriptorParentNameList)...) 176 } 177 178 func (l MetricDescriptorParentNameList) Slice(first, second int) gotenresource.ParentNameList { 179 if first > 0 && second > 0 { 180 return l[first:second] 181 } else if first > 0 { 182 return l[first:] 183 } else if second > 0 { 184 return l[:second] 185 } 186 return l[:] 187 } 188 189 func (l MetricDescriptorParentNameList) At(idx int) gotenresource.Name { 190 return l[idx] 191 } 192 193 func (l MetricDescriptorParentNameList) Set(idx int, name gotenresource.Name) { 194 l[idx] = name.(*ParentName) 195 } 196 197 func (l MetricDescriptorParentNameList) Length() int { 198 return len(l) 199 } 200 201 type MetricDescriptorParentReferenceList []*ParentReference 202 203 func (l MetricDescriptorParentReferenceList) Append(ref gotenresource.Reference) gotenresource.ParentReferenceList { 204 return append(l, ref.(*ParentReference)) 205 } 206 207 func (l MetricDescriptorParentReferenceList) AppendList(list gotenresource.ParentReferenceList) gotenresource.ParentReferenceList { 208 return append(l, list.(MetricDescriptorParentReferenceList)...) 209 } 210 211 func (l MetricDescriptorParentReferenceList) Slice(first, second int) gotenresource.ParentReferenceList { 212 if first > 0 && second > 0 { 213 return l[first:second] 214 } else if first > 0 { 215 return l[first:] 216 } else if second > 0 { 217 return l[:second] 218 } 219 return l[:] 220 } 221 222 func (l MetricDescriptorParentReferenceList) At(idx int) gotenresource.Reference { 223 return l[idx] 224 } 225 226 func (l MetricDescriptorParentReferenceList) Set(idx int, ref gotenresource.Reference) { 227 l[idx] = ref.(*ParentReference) 228 } 229 230 func (l MetricDescriptorParentReferenceList) Length() int { 231 return len(l) 232 } 233 234 type MetricDescriptorMap map[Name]*MetricDescriptor 235 236 func (m MetricDescriptorMap) Get(name gotenresource.Name) gotenresource.Resource { 237 return m[*name.(*Name)] 238 } 239 240 func (m MetricDescriptorMap) Set(res gotenresource.Resource) { 241 tRes := res.(*MetricDescriptor) 242 m[*tRes.Name] = tRes 243 } 244 245 func (m MetricDescriptorMap) Delete(name gotenresource.Name) { 246 delete(m, *name.(*Name)) 247 } 248 249 func (m MetricDescriptorMap) Length() int { 250 return len(m) 251 } 252 253 func (m MetricDescriptorMap) ForEach(cb func(gotenresource.Name, gotenresource.Resource) bool) { 254 for name, res := range m { 255 if !cb(&name, res) { 256 break 257 } 258 } 259 } 260 261 type MetricDescriptorChangeMap map[Name]*MetricDescriptorChange 262 263 func (m MetricDescriptorChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange { 264 return m[*name.(*Name)] 265 } 266 267 func (m MetricDescriptorChangeMap) Set(change gotenresource.ResourceChange) { 268 tChange := change.(*MetricDescriptorChange) 269 m[*tChange.GetMetricDescriptorName()] = tChange 270 } 271 272 func (m MetricDescriptorChangeMap) Delete(name gotenresource.Name) { 273 delete(m, *name.(*Name)) 274 } 275 276 func (m MetricDescriptorChangeMap) Length() int { 277 return len(m) 278 } 279 280 func (m MetricDescriptorChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) { 281 for name, res := range m { 282 if !cb(&name, res) { 283 break 284 } 285 } 286 }