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(*LockCreate, int))
| 1382 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 1383 | // a builder and applies setFunc on it. |
| 1384 | func (c *LockClient) MapCreateBulk(slice any, setFunc func(*LockCreate, int)) *LockCreateBulk { |
| 1385 | rv := reflect.ValueOf(slice) |
| 1386 | if rv.Kind() != reflect.Slice { |
| 1387 | return &LockCreateBulk{err: fmt.Errorf("calling to LockClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 1388 | } |
| 1389 | builders := make([]*LockCreate, rv.Len()) |
| 1390 | for i := 0; i < rv.Len(); i++ { |
| 1391 | builders[i] = c.Create() |
| 1392 | setFunc(builders[i], i) |
| 1393 | } |
| 1394 | return &LockCreateBulk{config: c.config, builders: builders} |
| 1395 | } |
| 1396 | |
| 1397 | // Update returns an update builder for Lock. |
| 1398 | func (c *LockClient) Update() *LockUpdate { |