github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/pkg/goutils/iterate/types.go (about)

     1  /*
     2   * Copyright (c) 2020-present unTill Pro, Ltd.
     3   * @author Denis Gribanov
     4   */
     5  
     6  package iterate
     7  
     8  // ForEachFunction is function type what enumerates all data in slice-like structures
     9  type ForEachFunction[T any] func(enum func(T))
    10  
    11  type ForEachFunction1Arg[T any, A1 any] func(arg1 A1, enum func(T))
    12  
    13  type ForEachFunction2Value[V1 any, V2 any] func(enum func(V1, V2))
    14  
    15  // ForEachMapFunc is function type what enumerates all key-value pairs in map-like structures
    16  type ForEachMapFunc[K comparable, V any] func(enum func(K, V))