You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
274 B
Go

package main
func GetAllHosts() (hosts []Host) {
DB.Find(&hosts)
return
}
func CreateHost(hostname string) bool {
host := Host{}
host.Hostname = hostname
result := DB.Create(&host)
// TODO: Handle errors
if result.Error != nil {
return false
}
return true
}