MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / Run

Method Run

db/functions/js_function.go:36–42  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

34}
35
36func (fn *jsInvocation) Run(ctx context.Context) (any, error) {
37 syncCtx, err := db.MakeUserCtx(fn.db.User(), base.DefaultScope, base.DefaultCollection)
38 if err != nil {
39 return nil, err
40 }
41 return fn.call(ctx, syncCtx, fn.args)
42}
43
44func (fn *jsInvocation) call(ctx context.Context, jsArgs ...any) (any, error) {
45 return fn.compiled.WithTask(ctx, func(task sgbucket.JSServerTask) (result any, err error) {

Callers

nothing calls this directly

Calls 3

callMethod · 0.95
MakeUserCtxFunction · 0.92
UserMethod · 0.45

Tested by

no test coverage detected