1
0
Fork 0

More config options

This commit is contained in:
Gregory Eremin 2015-03-05 19:53:38 +07:00
parent 76748c8c85
commit db21c27b54
2 changed files with 10 additions and 4 deletions

View File

@ -9,9 +9,13 @@ import (
type ( type (
Config struct { Config struct {
ClientID string `json:"github_client_id"` Domain string `json:"app_domain"`
ClientSecret string `json:"github_client_secret"` DatabaseURI string `json:"database_uri"`
RedirectURI string `json:"github_redirect_uri"` AuthURL string `json:"github_auth_url"`
AccessTokenURL string `json:"github_access_token_url"`
ClientID string `json:"github_client_id"`
ClientSecret string `json:"github_client_secret"`
RedirectURI string `json:"github_redirect_uri"`
} }
) )

View File

@ -2,6 +2,7 @@ package db
import ( import (
"database/sql" "database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
) )
@ -28,9 +29,10 @@ func stmt(query string) *sql.Stmt {
} }
func prepareStatement(query string) *sql.Stmt { func prepareStatement(query string) *sql.Stmt {
if stmt, err = conn.Prepare(query); err == nil { if stmt, err := conn.Prepare(query); err == nil {
return stmt return stmt
} else { } else {
fmt.Println(query)
panic(err) panic(err)
} }
} }