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