initial commit on github
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package v1
|
||||
|
||||
type App struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Secret string `json:"-"`
|
||||
IsVerified bool `json:"is_verified" db:"is_verified"`
|
||||
}
|
||||
|
||||
func FetchApp(id int) (*App, error) {
|
||||
var app = &App{}
|
||||
err := database.Get(app, "select * from apps where id=$1;", id)
|
||||
return app, err
|
||||
}
|
||||
|
||||
func FetchApps() ([]*App, error) {
|
||||
var apps = make([]*App, 0)
|
||||
err := database.Select(&apps, "select * from apps;")
|
||||
return apps, err
|
||||
}
|
||||
Reference in New Issue
Block a user