models

package
v0.0.0-...-3217735 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUILD_STATUS_NOT_START = 0
	BUILD_STATUS_BUILDING  = 1
	BUILD_STATUS_SUCCESS   = 2
	BUILD_STATUS_FAIL      = 3
	BUILD_STATUS_CANCELED  = 4
)
View Source
const (
	PROJECT_STATUS_NEED_TEST = 0
	PROJECT_STATUS_TESTING   = 1
	PROJECT_STATUS_SUCCESS   = 2
	PROJECT_STATUS_FAIL      = 3
)
View Source
const (
	WORKER_STATUS_IDLE = 0
	WORKER_STATUS_BUSY = 1
	WORKER_STATUS_DIE  = 2
)

Variables

This section is empty.

Functions

func AddBuild

func AddBuild(projectName string, branch string, commit string, commitTime time.Time, committer string) error

func AddBuildWithProject

func AddBuildWithProject(project Project) error

func AddGithubBuild

func AddGithubBuild(projectId int64, data githubutil.GithubPushHook) error

func AddGitlabBuild

func AddGitlabBuild(projectId int64, data gitlabutil.GitlabPushHook) error

func AddProject

func AddProject(project Project) error

func AddProjectWithNameUrl

func AddProjectWithNameUrl(projectName string, repoUrl string) error

For more usage in http://beego.me/docs/mvc/model/overview.md

func ReadOrCreateProject

func ReadOrCreateProject(userName string, projectName string, repoUrl string) (int64, error)

Read or create the project in database

func RegisterModels

func RegisterModels()

Types

type Build

type Build struct {
	Id          int64 `orm:"pk;auto"`
	ProjectId   int64
	UserName    string    `orm:"size(1024);null"`
	ProjectName string    `orm:"size(1024);null"`
	RepoUrl     string    `orm:"size(1024);null"`
	Branch      string    `orm:"size(1024);null"`
	Commit      string    `orm:"size(1024);null"`
	CommitTime  time.Time `orm:"null"`
	Committer   string    `orm:"size(1024);null"`
	BuildTime   time.Time `orm:"null"`
	FinishTime  time.Time `orm:"null"`
	Worker      string    `orm:"size(1024);null"`
	Status      int       `orm:"null"`
}

func GetAllBuilds

func GetAllBuilds() []*Build

func GetBuildWithId

func GetBuildWithId(buildId int64) Build

func GetBuildsWithProjectName

func GetBuildsWithProjectName(projectName string) []*Build

type Project

type Project struct {
	Id          int64  `orm:"pk;auto"`
	UserName    string `orm:"size(1024);null"`
	ProjectName string `orm:"size(1024);null"`
	RepoUrl     string `orm:"size(1024);null"`
	Status      int    `orm:"null"`
}

More setting in http://beego.me/docs/mvc/model/models.md

func GetAllProjects

func GetAllProjects() []*Project

For advanced usage in http://beego.me/docs/mvc/model/query.md#all

func GetProjectWithId

func GetProjectWithId(projectId int64) Project

type Worker

type Worker struct {
	Id         int64  `orm:"pk;auto"`
	Ip         string `orm:"size(1024)"`
	LastUpdate time.Time
	Status     int
}

func GetAllWorkers

func GetAllWorkers() []*Worker

func GetAllWorkersWithStatus

func GetAllWorkersWithStatus(status int) []*Worker

Jump to

Keyboard shortcuts

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