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

Method Copy

db/revision.go:87–99  ·  view source on GitHub ↗
(ctx context.Context, copyType BodyCopyType)

Source from the content-addressed store, hash-verified

85}
86
87func (body Body) Copy(ctx context.Context, copyType BodyCopyType) Body {
88 switch copyType {
89 case BodyShallowCopy:
90 return body.ShallowCopy()
91 case BodyDeepCopy:
92 return body.DeepCopy(ctx)
93 case BodyNoCopy:
94 return body
95 default:
96 base.InfofCtx(ctx, base.KeyCRUD, "Unexpected copy type specified in body.Copy - defaulting to shallow copy. copyType: %d", copyType)
97 return body.ShallowCopy()
98 }
99}
100
101func (body Body) ShallowCopy() Body {
102 if body == nil {

Callers 15

ComputeRolesForUserMethod · 0.45
inheritedChannelsMethod · 0.45
expandFieldsFunction · 0.45
TestAuditFieldsMergeFunction · 0.45
GetBodyBytesCountMethod · 0.45
AllDatabasesMethod · 0.45
_getLatestHLVCopyMethod · 0.45

Calls 3

ShallowCopyMethod · 0.95
DeepCopyMethod · 0.95
InfofCtxFunction · 0.92

Tested by 4

ComputeRolesForUserMethod · 0.36
TestAuditFieldsMergeFunction · 0.36