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