MCPcopy Create free account
hub / github.com/pydio/cells / GetDataSourceConfig

Method GetDataSourceConfig

data/source/sync/grpc/handler.go:283–302  ·  view source on GitHub ↗

GetDataSourceConfig implements the S3Endpoint Interface by using the real object configs + the local datasource configs for bucket and base folder.

(ctx context.Context, _ *object.GetDataSourceConfigRequest)

Source from the content-addressed store, hash-verified

281
282// GetDataSourceConfig implements the S3Endpoint Interface by using the real object configs + the local datasource configs for bucket and base folder.
283func (h *Handler) GetDataSourceConfig(ctx context.Context, _ *object.GetDataSourceConfigRequest) (*object.GetDataSourceConfigResponse, error) {
284
285 sh, ok := h.getSyncer(ctx)
286 if !ok {
287 return nil, errors.WithMessage(errors.StatusInternalServerError, "cannot find datasource in context")
288 }
289
290 if sh.SyncConfig == nil {
291 return nil, errors.WithMessage(errors.StatusServiceUnavailable, "syncConfig not initialized yet")
292 }
293 sh.SyncConfig.ObjectsHost = sh.ObjectConfig.RunningHost
294 sh.SyncConfig.ObjectsPort = sh.ObjectConfig.RunningPort
295 sh.SyncConfig.ObjectsSecure = sh.ObjectConfig.RunningSecure
296 sh.SyncConfig.ApiKey = sh.ObjectConfig.ApiKey
297 sh.SyncConfig.ApiSecret = sh.ObjectConfig.ApiSecret
298
299 return &object.GetDataSourceConfigResponse{
300 DataSource: sh.SyncConfig,
301 }, nil
302}
303
304// CleanResourcesBeforeDelete gracefully stops the sync task and remove the associated resync job
305func (h *Handler) CleanResourcesBeforeDelete(ctx context.Context, _ *object.CleanResourcesRequest) (*object.CleanResourcesResponse, error) {

Callers

nothing calls this directly

Calls 1

getSyncerMethod · 0.95

Tested by

no test coverage detected