You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Files in storages now are represented by storage.Object interface and its storage.LocalObject implementation.
They're usually used in two different scenarious:
Storage implementations provide LocalObjects from ListFolder funcs and in this case objects contain file names in their GetName.
New LocalObjects are created in the other code, for example in storage.ListFolderRecursively*** / multistorage.ListFolderRecursively*** funcs. Such objects may be constructed in a different way, for example, GetName may contain full / relative paths instead of just names.
The problem is that it's not always clear from the code what kind of object in hidden by the storage.Object interface: the original one provided from the storage, or a derivative one, which may contain a path in its GetName.
We should introduce a way to distinguish somehow between these different kinds of objects. The other option, and may be the better one, is to add the new GetPath() func to the storage.Object interface so that we won't need to create new derivative structs implementing storage.Object anywhere outside storage implementations.
The text was updated successfully, but these errors were encountered:
Files in storages now are represented by
storage.Object
interface and itsstorage.LocalObject
implementation.They're usually used in two different scenarious:
LocalObject
s fromListFolder
funcs and in this case objects contain file names in theirGetName
.LocalObject
s are created in the other code, for example instorage.ListFolderRecursively***
/multistorage.ListFolderRecursively***
funcs. Such objects may be constructed in a different way, for example,GetName
may contain full / relative paths instead of just names.The problem is that it's not always clear from the code what kind of object in hidden by the
storage.Object
interface: the original one provided from the storage, or a derivative one, which may contain a path in itsGetName
.We should introduce a way to distinguish somehow between these different kinds of objects. The other option, and may be the better one, is to add the new
GetPath()
func to thestorage.Object
interface so that we won't need to create new derivative structs implementingstorage.Object
anywhere outside storage implementations.The text was updated successfully, but these errors were encountered: