Help from a custom storage developement

Hi people, im developing an s3 adapter (compatible with 2.x) and im not have a clear explanations about methods with need be implemented, epecificly the read and delete methods.

how ghost uses these methods ?
no have any description and i m not know about delete images in ghost (delete, not only remove from mobiledoc)

Anyone can explain a little more about these ?

I couldn’t find documentation either, but it may help to look at the source code of other Ghost adapters to figure out what they’re doing.

For example, looking at the WebDAV adapter, it seems the delete function must:

  • delete the file with the given path
  • return true if deleting was successful and false otherwise

Similarly, read seems to get the (binary) contents of a file and return it, though you should probably double-check that since I’m not very experienced in that area.

Perhaps you could also check out this s3 adapter and see if it works, either for direct use, or to better understand how adapters function.

Hope that helps!

hi @badrihippo, thank you.
I already see this s3 adapter, but its not compatible(totaly) with 2.x , the last commits are very old.

have other problems, like the functions exists and delete are not realy implemented…

The problem are not cant see what these functions do itself, but understand where these are used in ghost (this i cant see).

I feel a lack of unit tests too, other s3 storage get me thoubles, i do not feel trust

I m develop and i m working in this storage now

Hi @luizamboni, I didn’t mean for you to use the Ghost adapter, but use it as an example. But if it’s for v1.0 I guess it’s not much help.

Good to hear you’re writing a fresh adapter for v2.x. Maybe you can see the official local-file-store adapter for some clues, but it’s quite limited.

I agree, it would be nice to have more documentation on how they work/when they’re used!

looking the code,the default localStorage, dont have read or delete methods ? as is required for plugins ?
i m very confused