public LineHandler(IWebhookDispatch webhookDispatch, ArcConfig config, IArcLog arcLog, IAlarmLog alarmLog) { this.webhookDispatch = webhookDispatch; this.config = config; this.arcLog = arcLog; this.alarmLog = alarmLog; }
public ArcServer(ILineHandlerFactory lineHandlerFactory, IPEndPoint endpoint, Socket socket, ArcConfig config, IArcLog arcLog) { this.lineHandlerFactory = lineHandlerFactory; this.endpoint = endpoint; this.socket = socket; this.config = config; this.arcLog = arcLog; lineHandlers = new List <ILineHandler>(); }
public GenericWebhookDispatch(ArcConfig config, IAccountsHandler accountsHandler, IArcLog arcLog) { if (config.WebhookEnabled) { configured = true; restClient = new RestClient(config.WebhookUrl); } this.accountsHandler = accountsHandler; this.arcLog = arcLog; }
public static IContainer BuildContainer(ArcConfig config) { var builder = new ContainerBuilder(); builder.RegisterInstance(new IPEndPoint(IPAddress.Any, (int)config.ListenPort)); builder.RegisterInstance(new Socket(IPAddress.Any.AddressFamily, SocketType.Stream, ProtocolType.Tcp)); builder.RegisterInstance(config); builder.RegisterType <LineHandler>() .As <ILineHandler>() .InstancePerDependency(); builder.RegisterType <LineHandlerFactory>() .As <ILineHandlerFactory>() .SingleInstance(); builder.RegisterType <ArcLog>() .As <IArcLog>() .SingleInstance(); builder.RegisterType <ArcServer>() .As <IArcServer>() .SingleInstance(); builder.RegisterType <AccountsHandler>() .As <IAccountsHandler>() .SingleInstance(); builder.RegisterType <GenericWebhookDispatch>() .As <IWebhookDispatch>() .SingleInstance(); builder.RegisterType <ArcConsole>() .As <IArcConsole>() .SingleInstance(); builder.RegisterType <AlarmLog>() .As <IAlarmLog>() .SingleInstance(); return(builder.Build()); }
public AccountsHandler(ArcConfig config, IArcLog arcLog) { this.config = config; this.arcLog = arcLog; LoadAccounts(); }