Document how to add a new provider
This commit is contained in:
Родитель
95d306cde0
Коммит
7fd1f0ae54
30
README.md
30
README.md
|
@ -13,3 +13,33 @@ dotnet run
|
|||
|
||||
On Windows, run the `./run.bat` file.
|
||||
|
||||
### Adding Custom Providers
|
||||
|
||||
File system providers are located at `./Camelotia.Services/Providers/`. To add a custom file system provider, you need to create a separate class and implement the [IProvider](https://github.com/worldbeater/Camelotia/blob/master/Camelotia.Services/Interfaces/IProvider.cs) interface. It'll get integrated into the UI automagically.
|
||||
|
||||
```cs
|
||||
public interface IProvider
|
||||
{
|
||||
string Size { get; }
|
||||
|
||||
string Name { get; }
|
||||
|
||||
string Description { get; }
|
||||
|
||||
Task<IEnumerable<FileModel>> Get(string path);
|
||||
|
||||
Task DownloadFile(string from, Stream to);
|
||||
|
||||
Task UploadFile(string to, Stream from);
|
||||
|
||||
IObservable<bool> IsAuthorized { get; }
|
||||
|
||||
bool SupportsDirectAuth { get; }
|
||||
|
||||
bool SupportsOAuth { get; }
|
||||
|
||||
Task DirectAuth(string login, string password);
|
||||
|
||||
Task OAuth();
|
||||
}
|
||||
```
|
||||
|
|
Загрузка…
Ссылка в новой задаче