MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
(slice any, setFunc func(*FsEventCreate, int))
| 1114 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 1115 | // a builder and applies setFunc on it. |
| 1116 | func (c *FsEventClient) MapCreateBulk(slice any, setFunc func(*FsEventCreate, int)) *FsEventCreateBulk { |
| 1117 | rv := reflect.ValueOf(slice) |
| 1118 | if rv.Kind() != reflect.Slice { |
| 1119 | return &FsEventCreateBulk{err: fmt.Errorf("calling to FsEventClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 1120 | } |
| 1121 | builders := make([]*FsEventCreate, rv.Len()) |
| 1122 | for i := 0; i < rv.Len(); i++ { |
| 1123 | builders[i] = c.Create() |
| 1124 | setFunc(builders[i], i) |
| 1125 | } |
| 1126 | return &FsEventCreateBulk{config: c.config, builders: builders} |
| 1127 | } |
| 1128 | |
| 1129 | // Update returns an update builder for FsEvent. |
| 1130 | func (c *FsEventClient) Update() *FsEventUpdate { |