github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1alpha2/limit/limit.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: Limit 3 // DO NOT EDIT!!! 4 5 package limit 6 7 import ( 8 gotenresource "github.com/cloudwan/goten-sdk/runtime/resource" 9 ) 10 11 // proto imports 12 import ( 13 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project" 14 limit_pool "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/limit_pool" 15 meta_resource "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/resource" 16 meta_service "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/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_project.Project{} 28 _ = &limit_pool.LimitPool{} 29 _ = &meta_resource.Resource{} 30 _ = &meta_service.Service{} 31 _ = &meta.Meta{} 32 ) 33 34 type LimitList []*Limit 35 36 func (l LimitList) Append(item gotenresource.Resource) gotenresource.ResourceList { 37 return append(l, item.(*Limit)) 38 } 39 40 func (l LimitList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 41 return append(l, list.(LimitList)...) 42 } 43 44 func (l LimitList) 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 LimitList) At(idx int) gotenresource.Resource { 56 return l[idx] 57 } 58 59 func (l LimitList) Set(idx int, res gotenresource.Resource) { 60 l[idx] = res.(*Limit) 61 } 62 63 func (l LimitList) Length() int { 64 return len(l) 65 } 66 67 type LimitChangeList []*LimitChange 68 69 func (l LimitChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList { 70 return append(l, item.(*LimitChange)) 71 } 72 73 func (l LimitChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList { 74 return append(l, list.(LimitChangeList)...) 75 } 76 77 func (l LimitChangeList) 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 LimitChangeList) At(idx int) gotenresource.ResourceChange { 89 return l[idx] 90 } 91 92 func (l LimitChangeList) Set(idx int, change gotenresource.ResourceChange) { 93 l[idx] = change.(*LimitChange) 94 } 95 96 func (l LimitChangeList) Length() int { 97 return len(l) 98 } 99 100 type LimitNameList []*Name 101 102 func (l LimitNameList) Append(name gotenresource.Name) gotenresource.NameList { 103 return append(l, name.(*Name)) 104 } 105 106 func (l LimitNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 107 return append(l, list.(LimitNameList)...) 108 } 109 110 func (l LimitNameList) 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 LimitNameList) At(idx int) gotenresource.Name { 122 return l[idx] 123 } 124 125 func (l LimitNameList) Set(idx int, name gotenresource.Name) { 126 l[idx] = name.(*Name) 127 } 128 129 func (l LimitNameList) Length() int { 130 return len(l) 131 } 132 133 type LimitReferenceList []*Reference 134 135 func (l LimitReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 136 return append(l, ref.(*Reference)) 137 } 138 139 func (l LimitReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 140 return append(l, list.(LimitReferenceList)...) 141 } 142 143 func (l LimitReferenceList) 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 LimitReferenceList) At(idx int) gotenresource.Reference { 155 return l[idx] 156 } 157 158 func (l LimitReferenceList) Set(idx int, ref gotenresource.Reference) { 159 l[idx] = ref.(*Reference) 160 } 161 162 func (l LimitReferenceList) Length() int { 163 return len(l) 164 } 165 166 type LimitParentNameList []*ParentName 167 168 func (l LimitParentNameList) Append(name gotenresource.Name) gotenresource.ParentNameList { 169 return append(l, name.(*ParentName)) 170 } 171 172 func (l LimitParentNameList) AppendList(list gotenresource.ParentNameList) gotenresource.ParentNameList { 173 return append(l, list.(LimitParentNameList)...) 174 } 175 176 func (l LimitParentNameList) 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 LimitParentNameList) At(idx int) gotenresource.Name { 188 return l[idx] 189 } 190 191 func (l LimitParentNameList) Set(idx int, name gotenresource.Name) { 192 l[idx] = name.(*ParentName) 193 } 194 195 func (l LimitParentNameList) Length() int { 196 return len(l) 197 } 198 199 type LimitParentReferenceList []*ParentReference 200 201 func (l LimitParentReferenceList) Append(ref gotenresource.Reference) gotenresource.ParentReferenceList { 202 return append(l, ref.(*ParentReference)) 203 } 204 205 func (l LimitParentReferenceList) AppendList(list gotenresource.ParentReferenceList) gotenresource.ParentReferenceList { 206 return append(l, list.(LimitParentReferenceList)...) 207 } 208 209 func (l LimitParentReferenceList) 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 LimitParentReferenceList) At(idx int) gotenresource.Reference { 221 return l[idx] 222 } 223 224 func (l LimitParentReferenceList) Set(idx int, ref gotenresource.Reference) { 225 l[idx] = ref.(*ParentReference) 226 } 227 228 func (l LimitParentReferenceList) Length() int { 229 return len(l) 230 } 231 232 type LimitMap map[Name]*Limit 233 234 func (m LimitMap) Get(name gotenresource.Name) gotenresource.Resource { 235 return m[*name.(*Name)] 236 } 237 238 func (m LimitMap) Set(res gotenresource.Resource) { 239 tRes := res.(*Limit) 240 m[*tRes.Name] = tRes 241 } 242 243 func (m LimitMap) Delete(name gotenresource.Name) { 244 delete(m, *name.(*Name)) 245 } 246 247 func (m LimitMap) Length() int { 248 return len(m) 249 } 250 251 func (m LimitMap) 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 LimitChangeMap map[Name]*LimitChange 260 261 func (m LimitChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange { 262 return m[*name.(*Name)] 263 } 264 265 func (m LimitChangeMap) Set(change gotenresource.ResourceChange) { 266 tChange := change.(*LimitChange) 267 m[*tChange.GetLimitName()] = tChange 268 } 269 270 func (m LimitChangeMap) Delete(name gotenresource.Name) { 271 delete(m, *name.(*Name)) 272 } 273 274 func (m LimitChangeMap) Length() int { 275 return len(m) 276 } 277 278 func (m LimitChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) { 279 for name, res := range m { 280 if !cb(&name, res) { 281 break 282 } 283 } 284 }