mySitio / cmd / web / models.go
models.go
Raw
package main

type appData struct { //holds data for each specific page
	Title string
	Index //reference for index page; embedded struct
}

type Index struct { //holds data specific to index page
	Abt *string
	Projects
	Skillz
	Articles
	Pets
	Contact
}

type Projects struct {
	Projects_Header *string
	Proj1           map[string]*string //Title, ProjectDescription, Link are indexes
	Proj2           map[string]*string
	Proj3           map[string]*string
}

type Skillz struct {
	Skillz_Header *string
	//Items will include "SkillCert" and "IconName"
	Items map[string]interface{} // create a slice of maps by declaring this outside main "type M map[string]interface{}"
	// do this then inside main "var myMapSlice []M" followed by each map like 'm1 := M{"dn": "abc", "status": "live"}' and then "myMapSlice = append(myMapSlice, m1, m2)""
}

type Articles struct {
	Articles_Header *string
}

type Pets struct {
	Pets_Header *string
}

type Contact struct {
	Contact_Header *string
}