koofr / graval

An experimental go FTP server framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Are there any existing drivers available?

dmitshur opened this issue · comments

From the usage section in README,

To boot an FTP server you will need to provide a driver that speaks to your persistence layer - the required driver contract is listed below.

Are there any existing drivers available? I can see that the original repo provided a sample in-memory driver, and a swift/graval driver.

It's great that an interface is used, making it possible to implement a variety of drivers, but it seems odd there isn't a single existing implementing mentioned or provided (unless I'm missing something?).

Consider that the standard library has image which provides a general interface for dealing with images, and the most common formats are also provided at image/png, image/jpeg. Third party packages provide additional formats, like golang.org/x/image/tiff. It's also possible to write your own code to implement the interface in image, but the point is that you can use it right away for most common use cases (png, jpeg).

Just wanted to get some clarification on this point, thanks!

There is a memory driver implementation in tests:

https://github.com/koofr/graval/blob/master/graval_test.go#L56

I could write an example filesystem implementation.

I've added memory driver implementation:

https://github.com/koofr/graval/tree/master/memory

Now there is also an example server that uses memory driver:

https://github.com/koofr/graval/blob/master/example/example.go

That's helpful, thanks!