Documentation
¶
Index ¶
Constants ¶
View Source
const ( RoleAdmin = "admin" RoleMember = "member" RoleGuest = "guest" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResp ¶
type CheckResp struct {
ID bson.ObjectId `json:"id" bson:"_id"`
ProjectID bson.ObjectId `json:"project_id" bson:"project_id"`
SHA1 string `json:"sha1" bson:"sha1"`
CommitID string `json:"commit_id" bson:"commit_id"`
Filename string `json:"filename" bson:"filename"`
CheckType string `json:"check_type" bson:"check_type"`
CheckName string `json:"check_name" bson:"check_name"`
LineNumber int `json:"line" bson:"line"`
Error string `json:"error" bson:"error"`
Created time.Time `json:"created" bson:"created"`
}
type CommitPatch ¶
type CommitPatch struct {
SHA string `json:"sha" bson:"sha"`
ProjectID bson.ObjectId `json:"project_id" bson:"project_id"`
Author string `json:"author" bson:"author"`
Message string `json:"message" bson:"message"`
}
CommitPatch one commit
type FilePatch ¶
type FilePatch struct {
ID bson.ObjectId `json:"id" bson:"_id"`
ProjectID bson.ObjectId `json:"project_id" bson:"project_id"`
CommitSHA string `json:"commit_sha" bson:"commit_sha"`
Filename string `json:"filename" bson:"filename"`
Mode string `json:"mode" bson:"mode"`
Old *LinePatch `json:"old" bson:"old"`
New *LinePatch `json:"new" bson:"new"`
}
FilePatch file changes
type GithubAccount ¶
type GithubAccount struct {
ID int `json:"id" bson:"id"`
Name string `json:"name" bson:"name"`
Login string `json:"login" bson:"login"`
Email string `json:"email" bson:"email"`
Location string `json:"location" bson:"location"`
Type string `json:"type" bson:"type"`
Password Password `json:"password" bson:"password"`
DeployKey Password `json:"deploy_key" bson:"deploy_key"`
Token Password `json:"token" bson:"token"`
}
GithubAccount:
type Member ¶
type Member struct {
UserID bson.ObjectId `json:"user_id" bson:"user_id"`
Role string `json:"role" bson:"role"`
}
Member 项目用户,用于权限管理
type Password ¶
type Password string
Password: ******
func (Password) MarshalJSON ¶
MarshalJSON: json
type Project ¶
type Project struct {
ID bson.ObjectId `json:"id" bson:"_id"`
OwnerID bson.ObjectId `json:"owner_id" bson:"owner_id"` // project owner
Owner string `json:"owner" bson:"owner"` // repos owner
Name string `json:"name" bson:"name"`
Desc string `json:"description" bson:"description"`
ReposID int64 `json:"repos_id" bson:"repos_id"`
ReposName string `json:"repos_name" bson:"repos_name"`
ReposFullname string `json:"repos_fullname" bson:"repos_fullname"`
Members []Member `json:"members" bson:"members"`
Created time.Time `json:"created" bson:"created"`
}
Project 构建项目
type User ¶
type User struct {
ID bson.ObjectId `json:"id" bson:"_id"`
Name string `json:"name" bson:"name"`
Email string `json:"email" bson:"email"`
Phone string `json:"phone" bson:"phone"`
Password Password `json:"password" bson:"password"`
Role string `json:"role" bson:"role"`
Created time.Time `json:"created" bson:"created"`
Updated time.Time `json:"updated" bson:"updated"`
LastLogin time.Time `json:"last_login" bson:"last_login"`
GithubAccount *GithubAccount `json:"github,omitempty" bson:"github,omitempty"`
WechatAccount *WechatAccount `json:"wechat,omitempty" bson:"wechat,omitempty"`
}
User:
type UserAuth ¶
type UserAuth struct {
ID bson.ObjectId `json:"id" bson:"_id"`
UserID bson.ObjectId `json:"user_id" bson:"user_id"`
Token string `json:"token" bson:"token"`
Created time.Time `json:"created" bson:"created"`
Lasted time.Time `json:"lasted" bson:"lasted"`
Expired time.Time `json:"expired" bson:"expired"`
}
UserAuth:
type WechatAccount ¶
type WechatAccount struct {
Name string `json:"name" bson:"name"`
}
WechatAccount:
Click to show internal directories.
Click to hide internal directories.