MCPcopy
hub / github.com/kopia/kopia / toRepoConnectOptions

Method toRepoConnectOptions

cli/command_repository_connect.go:92–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90}
91
92func (c *connectOptions) toRepoConnectOptions() *repo.ConnectOptions {
93 return &repo.ConnectOptions{
94 CachingOptions: content.CachingOptions{
95 CacheDirectory: c.connectCacheDirectory,
96 ContentCacheSizeBytes: c.contentCacheSizeMB << 20, //nolint:mnd
97 ContentCacheSizeLimitBytes: c.contentCacheSizeLimitMB << 20, //nolint:mnd
98 MetadataCacheSizeBytes: c.metadataCacheSizeMB << 20, //nolint:mnd
99 MetadataCacheSizeLimitBytes: c.metadataCacheSizeLimitMB << 20, //nolint:mnd
100 MaxListCacheDuration: content.DurationSeconds(c.maxListCacheDuration.Seconds()),
101 MinContentSweepAge: content.DurationSeconds(c.contentMinSweepAge.Seconds()),
102 MinMetadataSweepAge: content.DurationSeconds(c.metadataMinSweepAge.Seconds()),
103 MinIndexSweepAge: content.DurationSeconds(c.indexMinSweepAge.Seconds()),
104 },
105 ClientOptions: repo.ClientOptions{
106 Hostname: c.connectHostname,
107 Username: c.connectUsername,
108 ReadOnly: c.connectReadonly,
109 PermissiveCacheLoading: c.connectPermissiveCacheLoading,
110 Description: c.connectDescription,
111 EnableActions: c.connectEnableActions,
112 FormatBlobCacheDuration: c.getFormatBlobCacheDuration(),
113 },
114 }
115}
116
117func (c *App) runConnectCommandWithStorage(ctx context.Context, co *connectOptions, st blob.Storage) error {
118 pass, err := c.getPasswordFromFlags(ctx, false, false)

Callers 3

runMethod · 0.80
serverStartOptionsMethod · 0.80

Calls 2

DurationSecondsTypeAlias · 0.92

Tested by

no test coverage detected