logmania/database/app.go

14 lines
312 B
Go
Raw Normal View History

2017-06-12 22:32:27 +02:00
package database
type Application struct {
ID int `json:"id"`
Name string `json:"name"`
Token string `json:"token"`
//Entries []*Entry `json:"entries" gorm:"-"`
}
func IsTokenValid(token string) bool {
result := db.Where("token = ?", token).First(&Application{})
return !result.RecordNotFound()
}