MCPcopy
hub / github.com/weaviate/weaviate / getExportMetadata

Method getExportMetadata

usecases/export/scheduler.go:906–918  ·  view source on GitHub ↗

getExportMetadata retrieves export metadata from the backend

(ctx context.Context, backend modulecapabilities.BackupBackend, exportID, bucket, path string)

Source from the content-addressed store, hash-verified

904
905// getExportMetadata retrieves export metadata from the backend
906func (s *Scheduler) getExportMetadata(ctx context.Context, backend modulecapabilities.BackupBackend, exportID, bucket, path string) (*ExportMetadata, error) {
907 data, err := backend.GetObject(ctx, exportID, exportMetadataFile, bucket, path)
908 if err != nil {
909 return nil, fmt.Errorf("get metadata: %w", err)
910 }
911
912 var meta ExportMetadata
913 if err := json.Unmarshal(data, &meta); err != nil {
914 return nil, fmt.Errorf("unmarshal metadata: %w", err)
915 }
916
917 return &meta, nil
918}
919
920func validateExportID(id string) error {
921 if len(id) > exportIDMaxLength {

Callers 3

StatusMethod · 0.95
CancelMethod · 0.95
checkIfExportExistsMethod · 0.95

Calls 3

ErrorfMethod · 0.80
GetObjectMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected