Exemplo n.º 1
0
 public ConsoleChannel(
     IChecksumMemory checksumMemory,
     StalkrConfiguration stalkrConfiguration,
     IConfiguration configuration)
 {
     _stalkrConfiguration  = stalkrConfiguration;
     _checksumMemory       = checksumMemory;
     _channelConfiguration = new ChannelConfiguration(configuration.GetSection("Console"));
 }
Exemplo n.º 2
0
        public TelegramChannel(
            IChecksumMemory checksumMemory,
            StalkrConfiguration stalkrConfiguration,
            IConfiguration configuration,
            ILogger <TelegramChannel> logger)
        {
            _stalkrConfiguration = stalkrConfiguration;
            _checksumMemory      = checksumMemory;
            _logger = logger;

            _channelConfiguration = new TelegramConfiguration(configuration.GetSection("Telegram"));
        }
Exemplo n.º 3
0
        public static void InitApplication(IServiceCollection services)
        {
            LoadConfiguration();

            var stalkrConfiguration = StalkrConfiguration.FromConfiguration(Configuration);

            services.AddHostedService <Runnr>();

            services.AddSingleton <IChecksumMemory, ChecksumMemory>();
            services.AddSingleton(Configuration);
            services.AddSingleton(stalkrConfiguration);

            services.AddScoped <IChecksumStalkr, ChecksumStalkr>();
            services.AddScoped <IContentStalkr, ContentStalkr>();
            services.AddScoped <IStalkrService, StalkrService>();
            services.AddScoped <ISpamr, Spamr>();
            services.AddScoped <ISpamChannel, ConsoleChannel>();
            services.AddScoped <ISpamChannel, TelegramChannel>();
        }
Exemplo n.º 4
0
 public ContentStalkr(StalkrConfiguration config, ILogger <ContentStalkr> logger)
 {
     _config = config;
     _logger = logger;
 }