bountyforcode

package
v0.0.0-...-2c29924 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2014 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

bountyforcode - A bounty system for bug and feature fixes Copyright (C) 2013 Abhi Yerra <abhi@berkeley.edu>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	BountyStateNew       string = "new"
	BountyStatePaid      string = "paid"
	BountyStateClosed    string = "closed"
	BountyStateCancelled string = "cancelled"
)

Variables

View Source
var (
	PostgresHost string
	PostgresDb   string

	Db    *sql.DB
	DbMap *gorp.DbMap
)

Functions

func CloseDb

func CloseDb()

func GithubUser

func GithubUser(access_token string) (user *octokit.User)

func InitDb

func InitDb()

Types

type Bounty

type Bounty struct {
	Id                  int       `db:"id" json:"id"`
	UserId              int       `db:"user_id" json:"user_id"`
	IssueId             int       `db:"issue_id" json:"issue_id"`
	Amount              float32   `db:"amount" json:"amount"`
	CoinbaseButtonCode  string    `db:"coinbase_button_code" json:"coinbase_button_code"`
	CoinbaseOrderId     string    `db:"coinbase_order_id" json:"-"`
	CoinbaseTotalBtc    int       `db:"coinbase_total_btc" json:"coinbase_total_btc"`
	CoinbaseCurrencyIso string    `db:"coinbase_currency_iso" json:"coinbase_currency_iso"`
	Status              string    `db:"status" json:"status"`
	CreatedAt           time.Time `db:"created_at" json:"created_at"`
	UpdatedAt           time.Time `db:"updated_at" json:"updated_at"`
}

func FindBounties

func FindBounties(issue_id string) (b []Bounty)

func FindBountyByCoinbaseButtonCode

func FindBountyByCoinbaseButtonCode(coinbase_code string) (b *Bounty)

func NewBounty

func NewBounty(issue *Issue, user *User) (b *Bounty)

func (*Bounty) UpdateCoinbaseInfo

func (b *Bounty) UpdateCoinbaseInfo(order coinbase.Order)

type Issue

type Issue struct {
	Id          int            `db:"id" json:"id"`
	Hoster      string         `db:"hoster" json:"hoster"`
	Project     string         `db:"project" json:"project"`
	Repo        string         `db:"repo" json:"repo"`
	Identifier  string         `db:"identifier" json:"identifier"`
	OriginalUrl sql.NullString `db:"original_url" json:"original_url,omitempty"`
	CreatedAt   time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time      `db:"updated_at" json:"updated_at"`
}

func FindAllIssues

func FindAllIssues() (issues []Issue)

func FindIssue

func FindIssue(id string) (i *Issue)

func FindProjectIssues

func FindProjectIssues(project string) (issues []Issue)

func NewIssue

func NewIssue(scalp *scalpy.Scalp) (i *Issue)

type User

type User struct {
	Id                int       `db:"id" json:"id"`
	GithubUsername    string    `db:"github_username" json:"github_username"`
	GithubAccessToken string    `db:"github_access_token" json:"access_token"`
	CreatedAt         time.Time `db:"created_at" json:"created_at"`
	UpdatedAt         time.Time `db:"updated_at" json:"updated_at"`
}

func FindUser

func FindUser(id string) (u *User)

func NewUser

func NewUser(github_username, access_token string) (u *User)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL