LockFetch fetches & locks a resource
(ctx context.Context, s *schema.Schema, filter transaction.Filter, lockPolicy schema.LockPolicy, options *transaction.ViewOptions)
| 1130 | |
| 1131 | // LockFetch fetches & locks a resource |
| 1132 | func (tx *Transaction) LockFetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, lockPolicy schema.LockPolicy, options *transaction.ViewOptions) (*schema.Resource, error) { |
| 1133 | defer tx.measureTime(time.Now(), s.ID, "lock_fetch") |
| 1134 | |
| 1135 | list, _, err := tx.LockListContext(ctx, s, filter, nil, nil, lockPolicy) |
| 1136 | return lockFetchContextHelper(err, list, filter) |
| 1137 | } |
| 1138 | |
| 1139 | func lockFetchContextHelper(err error, list []*schema.Resource, filter transaction.Filter) (*schema.Resource, error) { |
| 1140 | if err != nil { |
no test coverage detected