Documentation
¶
Index ¶
- Constants
- Variables
- func AddOauth2(oa *Oauth2) error
- func BindUserOauth2(userId, oauthId int64) error
- func CreateNewBuilding(rid int64, branch string, os, arch string, action string) (err error)
- func CreateTasks(tasks []*Task) error
- func InitDB() (err error)
- func RefreshPageView(uri string, add ...int64) int64
- func ResetAllTaskStatus() error
- func ResetTask(tid int64) error
- func UpdatePubAddr(tid int64, pubAddr string) error
- func UpdateRepository(v *Repository, condi *Repository) (int64, error)
- func UpdateTaskStatus(tid int64, status string, output string) error
- type BuildHistory
- type DownloadHistory
- type LastRepoUpdate
- type Oauth2
- type PageView
- type RepoStatistic
- type Repository
- type Task
- func CreateTask(task *Task) (*Task, error)
- func GetAvaliableTask(os, arch string) (task *Task, err error)
- func GetAvaliableTasks(os, arch string) (tasks []*Task, err error)
- func GetOneDownloadableTask(rid int64, os, arch string) (*Task, error)
- func GetTaskById(tid int64) (*Task, error)
- func GetTasksByRid(rid int64) ([]Task, error)
Constants ¶
View Source
const ( OT_GITHUB = iota + 1 OT_BITBUCKET OT_OSCHINA )
OT: Oauth2 Type
View Source
const ( ST_READY = "ready" ST_PENDING = "pending" ST_RETRIEVING = "retrieving" ST_BUILDING = "building" ST_PACKING = "packing" ST_PUBLISHING = "publishing" ST_DONE = "done" ST_ERROR = "error" )
View Source
const ( AC_BUILD = "action-build" AC_SRCPKG = "action-source-package" )
Variables ¶
View Source
var ( ErrOauth2RecordNotExist = errors.New("OAuth2 record does not exist") ErrOauth2NotAssociated = errors.New("OAuth2 is not associated with user") )
View Source
var ( ErrTaskNotAvaliable = errors.New("not task ready for build now") ErrTaskNotExists = errors.New("task not exists") ErrNoAvaliableDownload = errors.New("no avaliable download") ErrTaskIsRunning = errors.New("task is running") )
View Source
var (
ErrRepositoryNotExists = errors.New("repo not found")
)
View Source
var GHClient *github.Client //= github.NewClient(httpClient)
Functions ¶
func BindUserOauth2 ¶
func CreateNewBuilding ¶
func CreateTasks ¶
func RefreshPageView ¶
func ResetAllTaskStatus ¶
func ResetAllTaskStatus() error
func UpdatePubAddr ¶
func UpdateRepository ¶
func UpdateRepository(v *Repository, condi *Repository) (int64, error)
Types ¶
type BuildHistory ¶
type BuildHistory struct {
Id int64
Tid int64 `xorm:"unique(b)"`
Status string `xorm:"unique(b)"`
Output string `xorm:"TEXT"`
Updated string `xorm:"updated"`
}
going to clean
func GetAllBuildHistoryByTid ¶
func GetAllBuildHistoryByTid(tid int64) ([]BuildHistory, error)
type DownloadHistory ¶
type LastRepoUpdate ¶
type LastRepoUpdate struct {
Rid int64 `xorm:"unique(u)"`
TagBranch string `xorm:"unique(u)"`
Os string `xorm:"unique(u)"`
Arch string `xorm:"unique(u)"`
PushURI string
ZipBallUrl string
Updated time.Time `xorm:"updated"`
}
func GetAllLastRepoByOsArch ¶
func GetAllLastRepoByOsArch(os, arch string) (us []LastRepoUpdate, err error)
func GetAllLastRepoUpdate ¶
func GetAllLastRepoUpdate(rid int64) (us []LastRepoUpdate, err error)
type Oauth2 ¶
type Oauth2 struct {
Id int64
Uid int64 `xorm:"unique(s)"` // userId
// User *User `xorm:"-"`
Type int `xorm:"unique(s) unique(oauth)"` // twitter,github,google...
Identity string `xorm:"unique(s) unique(oauth)"` // id..
Token string `xorm:"TEXT not null"`
}
func GetOauth2ById ¶
func GetOauthByUserId ¶
GetOauthByUserId returns list of oauthes that are releated to given user.
type RepoStatistic ¶
type Repository ¶
type Repository struct {
Id int64
Uri string `xorm:"unique(r)"`
Brief string
IsCgo bool
IsCmd bool
Tags []string
Created time.Time `xorm:"created"`
DownloadCount int64
}
func AddRepository ¶
func AddRepository(repoName string) (r *Repository, err error)
func CreateRepository ¶
func CreateRepository(r *Repository) (*Repository, error)
func GetAllRepos ¶
func GetAllRepos(count, start int) ([]Repository, error)
func GetRepositoryById ¶
func GetRepositoryById(id int64) (*Repository, error)
func GetRepositoryByName ¶
func GetRepositoryByName(name string) (*Repository, error)
type Task ¶
type Task struct {
Id int64
Rid int64 `xorm:"unique(t)"`
Repo *Repository `xorm:"-"`
Action string `xorm:"unique(t)"` // build or package
Os string `xorm:"unique(t)"`
Arch string `xorm:"unique(t)"`
CgoEnable bool
CommitMessage string
ZipBallUrl string
TagBranch string
PushType string //`xorm:"unique(t)"` // branch|tag|commit // not support with xorm(20140606)
PushValue string `xorm:"unique(t)"` //master|v1.2|45asf913
Status string
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
}
func CreateTask ¶
func GetAvaliableTask ¶
func GetAvaliableTasks ¶
func GetOneDownloadableTask ¶
func GetTaskById ¶
func GetTasksByRid ¶
Click to show internal directories.
Click to hide internal directories.