IterateFunctions iterates over all functions in the collection.
(ctx context.Context, callback func(f Function) (stop bool, err error))
| 258 | |
| 259 | // IterateFunctions iterates over all functions in the collection. |
| 260 | func (pgf *Collection) IterateFunctions(ctx context.Context, callback func(f Function) (stop bool, err error)) error { |
| 261 | for _, funcID := range pgf.idCache { |
| 262 | stop, err := callback(pgf.accessCache[funcID]) |
| 263 | if err != nil { |
| 264 | return err |
| 265 | } else if stop { |
| 266 | return nil |
| 267 | } |
| 268 | } |
| 269 | return nil |
| 270 | } |
| 271 | |
| 272 | // Clone returns a new *Collection with the same contents as the original. |
| 273 | func (pgf *Collection) Clone(ctx context.Context) *Collection { |
no outgoing calls
no test coverage detected