MCPcopy Create free account
hub / github.com/entireio/git-sync / buildSyncConfig

Method buildSyncConfig

client.go:113–133  ·  view source on GitHub ↗
(ctx context.Context, source Endpoint, target Endpoint, scope RefScope, policy SyncPolicy, collectStats, dryRun bool)

Source from the content-addressed store, hash-verified

111}
112
113func (c *Client) buildSyncConfig(ctx context.Context, source Endpoint, target Endpoint, scope RefScope, policy SyncPolicy, collectStats, dryRun bool) (internalbridge.Config, error) {
114 sourceAuth, err := c.authFor(ctx, source, SourceRole)
115 if err != nil {
116 return internalbridge.Config{}, err
117 }
118 targetAuth, err := c.authFor(ctx, target, TargetRole)
119 if err != nil {
120 return internalbridge.Config{}, err
121 }
122 return internalbridge.SyncConfig(
123 bridgeEndpoint(source),
124 bridgeEndpointAuth(sourceAuth),
125 bridgeEndpoint(target),
126 bridgeEndpointAuth(targetAuth),
127 bridgeScope(scope),
128 bridgePolicy(policy),
129 collectStats,
130 dryRun,
131 c.httpClient,
132 ), nil
133}
134
135func (c *Client) authFor(ctx context.Context, endpoint Endpoint, role EndpointRole) (EndpointAuth, error) {
136 if c.auth == nil {

Callers 2

PlanMethod · 0.95
SyncMethod · 0.95

Calls 6

authForMethod · 0.95
SyncConfigFunction · 0.92
bridgeEndpointFunction · 0.85
bridgeEndpointAuthFunction · 0.85
bridgeScopeFunction · 0.85
bridgePolicyFunction · 0.85

Tested by

no test coverage detected