functionland / react-native-fula

React (JS/Native) wrapper for go-fula/mobile which creates a bridge between Fula and WNFS for React Native to enable developers create mobile native apps
MIT License
2 stars 5 forks source link

receiveMeta in file protocol #16

Closed mehdibalouchi closed 1 year ago

mehdibalouchi commented 2 years ago

A method for receiving a file's metadata from a box by providing its CID

ghorbani-m commented 2 years ago

@mehdibalouchi Can you elaborate, on what kind of information we get/put with receiveMeta?

mehdibalouchi commented 2 years ago

meta is one of the actions defined in the file protocol (see here). When you upload a file with the file protocol using the send action, its metadata gets stored with it. You can then retrieve a file's metadata with the file protocol using the meta action. current structure of the metadata is:

message Meta {
  string name = 1;
  string type = 2;
  uint64 size = 3 [jstype = JS_NUMBER];
  int64 lastModified = 4 [jstype = JS_NUMBER];
  optional bytes preview = 5;
}

meta is currently implemented in fula-client and in go-fula libraries, but not in the react-native-fula

ehsan6sha commented 1 year ago

changed the protocol to wnfs