initial commit on github

This commit is contained in:
2021-05-02 16:04:45 +03:00
commit 7babade475
37 changed files with 3271 additions and 0 deletions
+20
View File
@@ -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
}