github.com/cloudwan/edgelq-sdk@v1.15.4/logging/resources/v1alpha2/log/log.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: Log 3 // DO NOT EDIT!!! 4 5 package log 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/v1alpha2/organization" 14 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project" 15 log_descriptor "github.com/cloudwan/edgelq-sdk/logging/resources/v1alpha2/log_descriptor" 16 meta "github.com/cloudwan/goten-sdk/types/meta" 17 structpb "google.golang.org/protobuf/types/known/structpb" 18 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 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 _ = &iam_organization.Organization{} 29 _ = &iam_project.Project{} 30 _ = &log_descriptor.LogDescriptor{} 31 _ = &structpb.Struct{} 32 _ = ×tamppb.Timestamp{} 33 _ = &meta.Meta{} 34 ) 35 36 type LogList []*Log 37 38 func (l LogList) Append(item gotenresource.Resource) gotenresource.ResourceList { 39 return append(l, item.(*Log)) 40 } 41 42 func (l LogList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 43 return append(l, list.(LogList)...) 44 } 45 46 func (l LogList) 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 LogList) At(idx int) gotenresource.Resource { 58 return l[idx] 59 } 60 61 func (l LogList) Set(idx int, res gotenresource.Resource) { 62 l[idx] = res.(*Log) 63 } 64 65 func (l LogList) Length() int { 66 return len(l) 67 } 68 69 type LogNameList []*Name 70 71 func (l LogNameList) Append(name gotenresource.Name) gotenresource.NameList { 72 return append(l, name.(*Name)) 73 } 74 75 func (l LogNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 76 return append(l, list.(LogNameList)...) 77 } 78 79 func (l LogNameList) Slice(first, second int) gotenresource.NameList { 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 LogNameList) At(idx int) gotenresource.Name { 91 return l[idx] 92 } 93 94 func (l LogNameList) Set(idx int, name gotenresource.Name) { 95 l[idx] = name.(*Name) 96 } 97 98 func (l LogNameList) Length() int { 99 return len(l) 100 } 101 102 type LogReferenceList []*Reference 103 104 func (l LogReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 105 return append(l, ref.(*Reference)) 106 } 107 108 func (l LogReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 109 return append(l, list.(LogReferenceList)...) 110 } 111 112 func (l LogReferenceList) Slice(first, second int) gotenresource.ReferenceList { 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 LogReferenceList) At(idx int) gotenresource.Reference { 124 return l[idx] 125 } 126 127 func (l LogReferenceList) Set(idx int, ref gotenresource.Reference) { 128 l[idx] = ref.(*Reference) 129 } 130 131 func (l LogReferenceList) Length() int { 132 return len(l) 133 } 134 135 type LogParentNameList []*ParentName 136 137 func (l LogParentNameList) Append(name gotenresource.Name) gotenresource.ParentNameList { 138 return append(l, name.(*ParentName)) 139 } 140 141 func (l LogParentNameList) AppendList(list gotenresource.ParentNameList) gotenresource.ParentNameList { 142 return append(l, list.(LogParentNameList)...) 143 } 144 145 func (l LogParentNameList) Slice(first, second int) gotenresource.ParentNameList { 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 LogParentNameList) At(idx int) gotenresource.Name { 157 return l[idx] 158 } 159 160 func (l LogParentNameList) Set(idx int, name gotenresource.Name) { 161 l[idx] = name.(*ParentName) 162 } 163 164 func (l LogParentNameList) Length() int { 165 return len(l) 166 } 167 168 type LogParentReferenceList []*ParentReference 169 170 func (l LogParentReferenceList) Append(ref gotenresource.Reference) gotenresource.ParentReferenceList { 171 return append(l, ref.(*ParentReference)) 172 } 173 174 func (l LogParentReferenceList) AppendList(list gotenresource.ParentReferenceList) gotenresource.ParentReferenceList { 175 return append(l, list.(LogParentReferenceList)...) 176 } 177 178 func (l LogParentReferenceList) Slice(first, second int) gotenresource.ParentReferenceList { 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 LogParentReferenceList) At(idx int) gotenresource.Reference { 190 return l[idx] 191 } 192 193 func (l LogParentReferenceList) Set(idx int, ref gotenresource.Reference) { 194 l[idx] = ref.(*ParentReference) 195 } 196 197 func (l LogParentReferenceList) Length() int { 198 return len(l) 199 } 200 201 type LogMap map[Name]*Log 202 203 func (m LogMap) Get(name gotenresource.Name) gotenresource.Resource { 204 return m[*name.(*Name)] 205 } 206 207 func (m LogMap) Set(res gotenresource.Resource) { 208 tRes := res.(*Log) 209 m[*tRes.Name] = tRes 210 } 211 212 func (m LogMap) Delete(name gotenresource.Name) { 213 delete(m, *name.(*Name)) 214 } 215 216 func (m LogMap) Length() int { 217 return len(m) 218 } 219 220 func (m LogMap) ForEach(cb func(gotenresource.Name, gotenresource.Resource) bool) { 221 for name, res := range m { 222 if !cb(&name, res) { 223 break 224 } 225 } 226 }