This commit is contained in:
artyom 2018-11-23 01:17:21 +03:00
Родитель 10176f79ed 7fd1f0ae54
Коммит caf9361f8f
1 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -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();
}
```