-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Since we define the type for Event in model/event.go, we should use that everywhere we access the event data type. This will ensure that when we make changes to the definition, it will be consistent.
For reference, right now the functionality to create a new event just takes in a lot of prompts, and then writes out a YAML file. The things it iterates through are all hardcoded in the logic of the addEvent function. Granted, this is all still defined in an external template, so that also gives us a bit of a headache.
I'm thinking that instead of defining the template in the .tpl type file and executing it, we can define the template inside the code. That also lets us maybe do something clever like just write out the name-value pairs for the things in the Event type. So we always will just be working off of the type.
That being said, that doesn't allow for any kind of user prompt for how to enter the data, so maybe we will still go through each prompt in the logic. But instead of writing to temporary variables and then executing the template, the addEvent (which really will become createEvent) will create a new Event, which we will point to and keep adding things to it. Then we can execute against that object in the template.