MCPcopy Create free account
hub / github.com/cloudwan/gohan / LockFetchContext

Method LockFetchContext

db/sql/sql.go:1132–1137  ·  view source on GitHub ↗

LockFetch fetches & locks a resource

(ctx context.Context, s *schema.Schema, filter transaction.Filter, lockPolicy schema.LockPolicy, options *transaction.ViewOptions)

Source from the content-addressed store, hash-verified

1130
1131// LockFetch fetches & locks a resource
1132func (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
1139func lockFetchContextHelper(err error, list []*schema.Resource, filter transaction.Filter) (*schema.Resource, error) {
1140 if err != nil {

Callers 1

LockFetchMethod · 0.95

Calls 3

measureTimeMethod · 0.95
LockListContextMethod · 0.95
lockFetchContextHelperFunction · 0.85

Tested by

no test coverage detected