|
| 1 | +// Package item contains the types and methods for items like talks, events, sponsors, etc. |
| 2 | +package item |
| 3 | + |
| 4 | +import "fmt" |
| 5 | + |
| 6 | +// Item is the overall interface for the items (wow, that's terrible) |
| 7 | +type Item interface { |
| 8 | + Create(city, year string) (*struct{}, error) |
| 9 | +} |
| 10 | + |
| 11 | +// Event is an event |
| 12 | +type Event struct { |
| 13 | + Name string `yaml:"name"` |
| 14 | + Year string `yaml:"year"` |
| 15 | + City string `yaml:"city"` |
| 16 | + EventTwitter string `yaml:"event_twitter"` |
| 17 | + Description string `yaml:"description"` |
| 18 | + GoogleAnalytics string `yaml:"ga_tracking_id"` |
| 19 | + StartDate string `yaml:"startdate"` |
| 20 | + EndDate string `yaml:"enddate"` |
| 21 | + CFPDateStart string `yaml:"cfp_date_start"` |
| 22 | + CFPDateEnd string `yaml:"cfp_date_end"` |
| 23 | + CFPDateAnnounce string `yaml:"cfp_date_announce"` |
| 24 | + CFPOpen string `yaml:"cfp_open"` |
| 25 | + CFPLink string `yaml:"cfp_link"` |
| 26 | + RegistrationDateStart string `yaml:"registration_date_start"` |
| 27 | + RegistrationDateEnd string `yaml:"registration_date_end"` |
| 28 | + RegistrationClosed string `yaml:"registration_closed"` |
| 29 | + RegistrationLink string `yaml:"registration_link"` |
| 30 | + MastheadBackground string `yaml:"masthead_background"` |
| 31 | + Coordinates string `yaml:"coordinates"` |
| 32 | + Location string `yaml:"location"` |
| 33 | + LocationAddress string `yaml:"location_address"` |
| 34 | + NavElements []string `yaml:"nav_elements"` |
| 35 | + TeamMembers []string `yaml:"team_members"` |
| 36 | + OrganizerEmail string `yaml:"organizer_email"` |
| 37 | + ProposalEmail string `yaml:"proposal_email"` |
| 38 | + Sponsors []string `yaml:"sponsors"` |
| 39 | + SponsorsAccepted string `yaml:"sponsors_accepted"` |
| 40 | + SponsorLevels []string `yaml:"sponsor_levels"` |
| 41 | +} |
| 42 | + |
| 43 | +func (e *Event) Create(city, year string) (*Event, error) { |
| 44 | + myEvent := new(Event) |
| 45 | + myEvent.Name = "Hello" |
| 46 | + return myEvent, nil |
| 47 | +} |
| 48 | + |
| 49 | +func ShowEvent() { |
| 50 | + e := new(Event) |
| 51 | + event, _ := e.Create("Ponyville", "2017") |
| 52 | + fmt.Println(event) |
| 53 | +} |
0 commit comments