Ejemplo n.º 1
0
        public IActionResult Populate(string topicname)
        {
            var text = AvroHelper.PopulateAvroJson(_schema[topicname]);

            return(View("Produce", new ProducerViewModel
            {
                TopicNames = FIleHelper.GetAllFiles(_settings.SchemaDirectory, Constants.AvroSchemaFileExtension)
            }));
        }
Ejemplo n.º 2
0
        public IActionResult Produce(string topicname = null)
        {
            var topics = FIleHelper.GetAllFiles(_settings.SchemaDirectory, Constants.AvroSchemaFileExtension);

            if (string.IsNullOrEmpty(topicname))
            {
                return(View(new ProducerViewModel
                {
                    TopicNames = topics
                }));
            }

            return(View(new ProducerViewModel
            {
                TopicNames = FIleHelper.GetAllFiles(_settings.SchemaDirectory, Constants.AvroSchemaFileExtension),
                CurrentTopic = topicname,
                AvroJson = _schema.ContainsKey(topicname) ? AvroHelper.PopulateAvroJson(_schema[topicname]) : string.Empty
            }));
        }
Ejemplo n.º 3
0
        public IActionResult Refresh()
        {
            AvroHelper.GenerateAvroTypes(_settings.AvrogenDirectory, _settings.SchemaDirectory, _settings.MessageTypeDirectory);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
 public HomeController(IOptions <ApplicationSettings> options)
 {
     _settings = options.Value;
     _schema   = AvroHelper.LoadCurrentSchema(_settings.SchemaDirectory);
 }