Documentation ¶
Overview ¶
Copyright (C) 2017 The BlameWarrior Authors.
This file is a part of BlameWarrior service.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
Constants ¶
const ( GetUserByNicknameQuery = "SELECT token, uid, nickname, avatar_url, name FROM users WHERE nickname = $1" SaveUserQuery = `` /* 286-byte string literal not displayed */ )
Variables ¶
var UserNotFound = errors.New("User not found")
Functions ¶
func ConnectDatabase ¶
func ConnectDatabase(dbName string, opts ...*DatabaseOptions) (*sql.DB, error)
Types ¶
type DatabaseOptions ¶
type DatabaseOptions struct { // Host is PostgreSQL database host Host string // Port is PostgreSQL database port Port string // User is connection user User string // Password is connection password to authenticate with Password string }
DatabaseOptions is a configuration object type to pass PostgreSQL connection options.
func (*DatabaseOptions) ConnectionString ¶
func (opts *DatabaseOptions) ConnectionString() string
ConnectionString returns a connection string suitable to for sql.DB().
type User ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}