models

package
v0.0.0-...-cf3502d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: MIT Imports: 12 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GITHUB_TOKEN   = os.Getenv("GITHUB_TOKEN")
	REDIS_ADDR     = os.Getenv("REDIS_ADDR")
	REDIS_PASSWORD = os.Getenv("REDIS_PASSWORD")
	MYSQL_URI      = os.Getenv("MYSQL_URI")
	CDN_URL_BASE   = os.Getenv("CDN_URL_BASE")
)
View Source
var (
	DefaultTriggerOwner = "gobuild"
	DefaultTriggerRepo  = "travis-autobuild"
)

Functions

func GetRedisClient

func GetRedisClient() *redis.Client

func TriggerTravisBuild

func TriggerTravisBuild(owner, repo, branch, email string) error

Types

type Repository

type Repository struct {
	Id        int64     `json:"id"`
	Owner     string    `xorm:"unique(nn)" json:"owner"`
	Repo      string    `xorm:"unique(nn)" json:"repo"`
	UserId    int64     `xorm:"'user_id'" json:"-"`
	Refs      []string  `json:"refs"` // can be branch or tag
	Valid     bool      `json:"valid"`
	Official  bool      `json:"official"`
	Download  uint64    `json:"download"`
	CreatedAt time.Time `xorm:"created" json:"created_at"`
	UpdatedAt time.Time `xorm:"updated" json:"updated_at"`
	TriggerAt time.Time `json:"trigger_at"`
}

func (*Repository) AddBranch

func (r *Repository) AddBranch(name string) error

type User

type User struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Email       string `xorm:"unique" json:"email"`
	GithubToken string `xorm:"github_token" json:"-"`
	Admin       bool   `json:"admin"`

	CreatedAt     time.Time `xorm:"created" json:"created_at"`
	UpdatedAt     time.Time `xorm:"updated" json:"updated_at"`
	RepoUpdatedAt time.Time `json:"repo_updated_at"`
}

func (*User) Repositories

func (user *User) Repositories() ([]Repository, error)

func (*User) SyncGithub

func (user *User) SyncGithub() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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