cli API cx
parent
445c21f9d9
commit
3db20342ef
@ -1,11 +1,25 @@
|
|||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Extensions.OptionsModel;
|
||||||
|
|
||||||
public class Streamer {
|
namespace cli {
|
||||||
private ClientWebSocket _client;
|
|
||||||
|
public class Streamer {
|
||||||
|
private ClientWebSocket _client;
|
||||||
|
private ILogger _logger;
|
||||||
|
private ConnectionSettings _cxSettings;
|
||||||
|
private UserConnectionSettings _userCxSettings;
|
||||||
|
|
||||||
public Streamer(string token)
|
public Streamer(ILoggerFactory loggerFactory,
|
||||||
{
|
IOptions<ConnectionSettings> cxSettings,
|
||||||
_client = new ClientWebSocket();
|
IOptions<UserConnectionSettings> userCxSettings
|
||||||
_client.Options.SetRequestHeader("Authorization", $"Bearer {token}");
|
)
|
||||||
}
|
{
|
||||||
|
_logger = loggerFactory.CreateLogger<Streamer>();
|
||||||
|
_cxSettings = cxSettings.Value;
|
||||||
|
_userCxSettings = userCxSettings.Value;
|
||||||
|
_client = new ClientWebSocket();
|
||||||
|
_client.Options.SetRequestHeader("Authorization", $"Bearer {_userCxSettings.AccessToken}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"Connection": {
|
|
||||||
"Authority": "dev.pschneider.fr",
|
|
||||||
"ClientId": "53f4d5da-93a9-4584-82f9-b8fdf243b002",
|
|
||||||
"ClientSecret": "blouh",
|
|
||||||
"Audience": "dev.pschneider.fr"
|
|
||||||
},
|
|
||||||
"Smtp": {
|
|
||||||
"Host": "127.0.0.1",
|
|
||||||
"Port": 25,
|
|
||||||
"EnableSSL": false
|
|
||||||
},
|
|
||||||
"Logging": {
|
|
||||||
"IncludeScopes": true,
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Debug",
|
|
||||||
"System": "Warning",
|
|
||||||
"Microsoft": "Warning"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ConnectionStrings": {
|
|
||||||
"Default":"Server=localhost;Port=5432;Database=YavscDev;Username=yavscdev;Password=admin;"
|
|
||||||
},
|
|
||||||
"gen_mvc" : {
|
|
||||||
"NameSpace": "Yavsc",
|
|
||||||
"AppBase": "../Yavsc",
|
|
||||||
"RelativePath": "Controllers/Generated",
|
|
||||||
"DbContextFullName": "Yavsc.Models.ApplicationDbContext",
|
|
||||||
"ControllerName": "LiveFlowController",
|
|
||||||
"ModelFullName": "Yavsc.Models.Streaming.LiveFlow"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue