Versions in this module Expand all Collapse all v0 v0.3.1 Apr 29, 2014 Changes in this version type User + func LoginUserLdap(name, passwd string) (*User, error) v0.3.0 Apr 21, 2014 Changes in this version + const OP_PUSH_TAG + const OP_TRANSFER_REPO + const OT_BITBUCKET + const OT_FACEBOOK + const OT_GITHUB + const OT_GOOGLE + const OT_OSCHINA + const OT_QQ + const OT_TWITTER + const OT_WEIBO + var EnableSQLite3 bool + var ErrMirrorNotExist = errors.New("Mirror does not exist") + var ErrOauth2NotAssociated = errors.New("OAuth2 is not associated with user") + var ErrOauth2RecordNotExist = errors.New("OAuth2 record does not exist") + var ErrReleaseAlreadyExist = errors.New("Release already exist") + func AddOauth2(oa *Oauth2) error + func BindUserOauth2(userId, oauthId int64) error + func ChangeRepositoryName(userName, oldRepoName, newRepoName string) (err error) + func ChangeUserName(user *User, newUserName string) (err error) + func CreateRelease(repoPath string, rel *Release, gitRepo *git.Repository) error + func GetUserEmailsByNames(names []string) []string + func IsReleaseExist(repoId int64, tagName string) (bool, error) + func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error + func MirrorUpdate() + func SetRepoEnvs(userId int64, userName, repoName string) + func TransferOwnership(user *User, newOwner string, repo *Repository) (err error) + func TransferRepoAction(user, newUser *User, repo *Repository) (err error) + func Update(refName, oldCommitId, newCommitId, userName, repoName string, userId int64) + func UpdateAccess(access *Access) error + func UpdateAccessWithSession(sess *xorm.Session, access *Access) error + func UpdateMirror(m *Mirror) error type DiffFile + IsBin bool + type Mirror struct + Id int64 + Interval int + NextUpdate time.Time + RepoId int64 + RepoName string + Updated time.Time + func GetMirror(repoId int64) (*Mirror, error) + type Oauth2 struct + Id int64 + Identity string + Token string + Type int + Uid int64 + User *User + func GetOauth2(identity string) (oa *Oauth2, err error) + func GetOauth2ById(id int64) (oa *Oauth2, err error) + func GetOauthByUserId(uid int64) (oas []*Oauth2, err error) + type Release struct + Created time.Time + Id int64 + IsPrerelease bool + LowerTagName string + Note string + NumCommits int + NumCommitsBehind int + Publisher *User + PublisherId int64 + RepoId int64 + SHA1 string + TagName string + Title string + func GetReleasesByRepoId(repoId int64) (rels []*Release, err error) type Repository + DefaultBranch string + IsGoget bool + IsMirror bool + NumTags int + Owner *User + func GetRecentUpdatedRepositories() (repos []*Repository, err error) + func MigrateRepository(user *User, name, desc string, private, mirror bool, url string) (*Repository, error) type User + Salt string + func GetUserByEmail(email string) (*User, error) v0.2.0 Mar 31, 2014 Changes in this version + const AU_READABLE + const AU_WRITABLE + const DIFF_FILE_ADD + const DIFF_FILE_CHANGE + const DIFF_FILE_DEL + const DIFF_HEAD + const DIFF_LINE_ADD + const DIFF_LINE_DEL + const DIFF_LINE_PLAIN + const DIFF_LINE_SECTION + const IT_CLOSE + const IT_PLAIN + const IT_REOPEN + const LT_LDAP + const LT_PLAIN + const OP_COMMIT_REPO + const OP_CREATE_ISSUE + const OP_CREATE_REPO + const OP_DELETE_REPO + const OP_FOLLOW_REPO + const OP_PULL_REQUEST + const OP_STAR_REPO + const TPL_PUBLICK_KEY + const UT_INDIVIDUAL + const UT_ORGANIZATION + var DbCfg struct + var ErrEmailAlreadyUsed = errors.New("E-mail already used") + var ErrIssueNotExist = errors.New("Issue does not exist") + var ErrKeyAlreadyExist = errors.New("Public key already exist") + var ErrKeyNotExist = errors.New("Public key does not exist") + var ErrRepoAlreadyExist = errors.New("Repository already exist") + var ErrRepoFileNotExist = errors.New("Target Repo file does not exist") + var ErrRepoFileNotLoaded = fmt.Errorf("repo file not loaded") + var ErrRepoNameIllegal = errors.New("Repository name contains illegal characters") + var ErrRepoNotExist = errors.New("Repository does not exist") + var ErrUserAlreadyExist = errors.New("User already exist") + var ErrUserNameIllegal = errors.New("User name contains illegal characters") + var ErrUserNotExist = errors.New("User does not exist") + var ErrUserOwnRepos = errors.New("User still have ownership of repositories") + var HasEngine bool + var LanguageIgns []string + var Licenses []string + var UseSQLite3 bool + func AddAccess(access *Access) error + func AddPublicKey(key *PublicKey) (err error) + func CommitRepoAction(userId int64, userName, actEmail string, repoId int64, repoName string, ...) error + func CreateComment(userId, repoId, issueId, commitId, line int64, cmtType int, content string) error + func DeletePublicKey(key *PublicKey) (err error) + func DeleteRepository(userId, repoId int64, userName string) (err error) + func DeleteUser(user *User) error + func FollowUser(userId int64, followId int64) (err error) + func ForkRepository(reposName string, userId int64) + func GenAuthorizedKey(keyId int64, key string) string + func GetBranches(userName, repoName string) ([]string, error) + func GetCommit(userName, repoName, commitId string) (*git.Commit, error) + func GetCommitsByBranch(userName, repoName, branchName string) (*list.List, error) + func GetCommitsByCommitId(userName, repoName, commitId string) (*list.List, error) + func GetRepositoryCount(user *User) (int64, error) + func GetUserIssueCount(userId, repoId int64) int64 + func GetUserSalt() string + func HasAccess(userName, repoName string, mode int) (bool, error) + func IsBranchExist(userName, repoName, branchName string) bool + func IsEmailUsed(email string) (bool, error) + func IsLegalName(repoName string) bool + func IsRepositoryExist(user *User, repoName string) (bool, error) + func IsUserExist(name string) (bool, error) + func IsWatching(userId, repoId int64) bool + func LoadModelsConfig() + func LoadRepoConfig() + func NewEngine() (err error) + func NewRepoAction(user *User, repo *Repository) (err error) + func NewRepoContext() + func NewTestEngine(x *xorm.Engine) (err error) + func NotifyWatchers(act *Action) error + func RepoPath(userName, repoName string) string + func SaveAuthorizedKeyFile(key *PublicKey) error + func SetEngine() (err error) + func UnFollowUser(userId int64, unFollowId int64) (err error) + func UpdateIssue(issue *Issue) error + func UpdateRepository(repo *Repository) error + func UpdateUser(user *User) (err error) + func UserPath(userName string) string + func WatchRepo(userId, repoId int64, watch bool) (err error) + type Access struct + Created time.Time + Id int64 + Mode int + RepoName string + UserName string + type Action struct + ActEmail string + ActUserId int64 + ActUserName string + Content string + Created time.Time + Id int64 + OpType int + RefName string + RepoId int64 + RepoName string + UserId int64 + func GetFeeds(userid, offset int64, isProfile bool) ([]Action, error) + func (a Action) GetActEmail() string + func (a Action) GetActUserName() string + func (a Action) GetBranch() string + func (a Action) GetContent() string + func (a Action) GetOpType() int + func (a Action) GetRepoName() string + type Comment struct + CommitId int64 + Content string + Created time.Time + Id int64 + IssueId int64 + Line int64 + Poster *User + PosterId int64 + Type int + func GetIssueComments(issueId int64) ([]Comment, error) + type Diff struct + Files []*DiffFile + TotalAddition int + TotalDeletion int + func GetDiff(repoPath, commitid string) (*Diff, error) + func ParsePatch(reader io.Reader) (*Diff, error) + func (diff *Diff) NumFiles() int + type DiffFile struct + Addition int + Deletion int + Name string + Sections []*DiffSection + Type int + type DiffLine struct + Content string + LeftIdx int + RightIdx int + Type int + func (d DiffLine) GetType() int + type DiffSection struct + Lines []*DiffLine + Name string + type Follow struct + FollowId int64 + Id int64 + UserId int64 + type Issue struct + AssigneeId int64 + Content string + Created time.Time + Id int64 + Index int64 + IsClosed bool + IsPull bool + Labels string + Mentions string + MilestoneId int64 + Name string + NumComments int + Poster *User + PosterId int64 + RenderedContent string + Repo *Repository + RepoId int64 + Updated time.Time + func CreateIssue(userId, repoId, milestoneId, assigneeId int64, issueCount int, ...) (issue *Issue, err error) + func GetIssueByIndex(repoId, index int64) (*Issue, error) + func GetIssues(userId, repoId, posterId, milestoneId int64, page int, ...) ([]Issue, error) + type Label struct + Colors string + Id int64 + Names string + RepoId int64 + type Member struct + Id int64 + OrgId int64 + UserId int64 + type Milestone struct + Content string + Created time.Time + DueDate time.Time + Id int64 + IsClosed bool + Name string + NumIssues int + RepoId int64 + type PublicKey struct + Content string + Created time.Time + Fingerprint string + Id int64 + Name string + OwnerId int64 + Updated time.Time + func ListPublicKey(userId int64) ([]PublicKey, error) + type RepoFile struct + Commit *git.Commit + Path string + Repo *git.Repository + Size int64 + func GetReposFiles(userName, repoName, commitId, rpath string) ([]*RepoFile, error) + func GetTargetFile(userName, repoName, branchName, commitId, rpath string) (*RepoFile, error) + func (file *RepoFile) LookupBlob() (*git.Blob, error) + type Repository struct + Created time.Time + Description string + ForkId int64 + Id int64 + IsBare bool + IsPrivate bool + LowerName string + Name string + NumClosedIssues int + NumForks int + NumIssues int + NumOpenIssues int + NumStars int + NumWatches int + OwnerId int64 + Updated time.Time + Website string + func CreateRepository(user *User, repoName, desc, repoLang, license string, private bool, ...) (*Repository, error) + func GetRepositories(user *User) ([]Repository, error) + func GetRepositoryById(id int64) (*Repository, error) + func GetRepositoryByName(userId int64, repoName string) (*Repository, error) + type Statistic struct + Counter struct{ ... } + func GetStatistic() (stats Statistic) + type User struct + Avatar string + AvatarEmail string + Created time.Time + Email string + Id int64 + IsActive bool + IsAdmin bool + Location string + LoginType int + LowerName string + Name string + NumFollowers int + NumFollowings int + NumRepos int + NumStars int + Passwd string + Rands string + Type int + Updated time.Time + Website string + func GetUserById(id int64) (*User, error) + func GetUserByKeyId(keyId int64) (*User, error) + func GetUserByName(name string) (*User, error) + func GetUsers(num, offset int) ([]User, error) + func LoginUserPlain(name, passwd string) (*User, error) + func RegisterUser(user *User) (*User, error) + func VerifyUserActiveCode(code string) (user *User) + func (user *User) AvatarLink() string + func (user *User) EncodePasswd() error + func (user *User) HomeLink() string + func (user *User) NewGitSig() *git.Signature + type UserRepo struct + UserName string + func GetRepos(num, offset int) ([]UserRepo, error) + type Watch struct + Id int64 + RepoId int64 + UserId int64 + func GetWatches(repoId int64) ([]Watch, error)