Versions in this module Expand all Collapse all v0 v0.5.2 Mar 8, 2018 v0.5.1 Mar 8, 2018 v0.4.3 Mar 8, 2018 v0.4.2 Oct 18, 2017 v0.4.1 Oct 18, 2017 v0.3.1 Oct 2, 2017 Changes in this version + var DbCfg struct + var EnableSQLite3 bool + var HasEngine bool + func CountUsers() int64 + func CreateGitxt(g *Gitxt) (err error) + func CreateUser(u *User) (err error) + func DeleteExpiredRepositories() + func DeleteOldRepositoryArchives() + func DeleteRepository(ownerID int64, repoID int64) error + func GetUserSalt() (string, error) + func InitDb() + func IsErrDeployKeyAlreadyExist(err error) bool + func IsErrDeployKeyNameAlreadyUsed(err error) bool + func IsErrDeployKeyNotExist(err error) bool + func IsErrEmailAlreadyUsed(err error) bool + func IsErrHashAlreadyExist(err error) bool + func IsErrKeyAccessDenied(err error) bool + func IsErrKeyAlreadyExist(err error) bool + func IsErrKeyNameAlreadyUsed(err error) bool + func IsErrKeyNotExist(err error) bool + func IsErrKeyUnableVerify(err error) bool + func IsErrNamePatternNotAllowed(err error) bool + func IsErrNameReserved(err error) bool + func IsErrUserAlreadyExist(err error) bool + func IsErrUserOwnRepos(err error) bool + func IsHashUsed(uid int64, hash string) (bool, error) + func IsUsableUsername(name string) error + func IsUserExist(uid int64, name string) (bool, error) + func LoadConfigs() + func NewEngine() (err error) + func NewMailerUser(u *User) mailer.User + func NewTestEngine(x *xorm.Engine) (err error) + func Ping() error + func SetEngine() (err error) + func UpdateCounterGitxts(u int64) error + func UpdateCounterGitxtsManaged(c int64) error + func UpdateGitxt(u *Gitxt) error + func UpdateUser(u *User) error + func UserPath(userName string) string + type Counter struct + Count int64 + ID int64 + Name string + func GetCounterGitxts() (*Counter, error) + func GetCounterGitxtsManaged() (*Counter, error) + type Engine interface + Delete func(interface{}) (int64, error) + Exec func(string, ...interface{}) (sql.Result, error) + Find func(interface{}, ...interface{}) error + Get func(interface{}) (bool, error) + Id func(interface{}) *xorm.Session + In func(string, ...interface{}) *xorm.Session + Insert func(...interface{}) (int64, error) + InsertOne func(interface{}) (int64, error) + Iterate func(interface{}, xorm.IterFunc) error + Sql func(string, ...interface{}) *xorm.Session + Table func(interface{}) *xorm.Session + Where func(interface{}, ...interface{}) *xorm.Session + type ErrDeployKeyAlreadyExist struct + KeyID int64 + RepoID int64 + func (err ErrDeployKeyAlreadyExist) Error() string + type ErrDeployKeyNameAlreadyUsed struct + Name string + RepoID int64 + func (err ErrDeployKeyNameAlreadyUsed) Error() string + type ErrDeployKeyNotExist struct + ID int64 + KeyID int64 + RepoID int64 + func (err ErrDeployKeyNotExist) Error() string + type ErrEmailAlreadyUsed struct + Email string + func (err ErrEmailAlreadyUsed) Error() string + type ErrHashAlreadyExist struct + Hash string + func (err ErrHashAlreadyExist) Error() string + type ErrKeyAccessDenied struct + KeyID int64 + Note string + UserID int64 + func (err ErrKeyAccessDenied) Error() string + type ErrKeyAlreadyExist struct + Content string + OwnerID int64 + func (err ErrKeyAlreadyExist) Error() string + type ErrKeyNameAlreadyUsed struct + Name string + OwnerID int64 + func (err ErrKeyNameAlreadyUsed) Error() string + type ErrKeyNotExist struct + ID int64 + func (err ErrKeyNotExist) Error() string + type ErrKeyUnableVerify struct + Result string + func (err ErrKeyUnableVerify) Error() string + type ErrNamePatternNotAllowed struct + Pattern string + func (err ErrNamePatternNotAllowed) Error() string + type ErrNameReserved struct + Name string + func (err ErrNameReserved) Error() string + type ErrUserAlreadyExist struct + Name string + func (err ErrUserAlreadyExist) Error() string + type ErrUserOwnRepos struct + UID int64 + func (err ErrUserOwnRepos) Error() string + type Gitxt struct + Anonymous bool + Created time.Time + CreatedUnix int64 + Description string + Expiry time.Time + ExpiryHours int64 + ExpiryUnix int64 + Hash string + ID int64 + IsPrivate bool + Updated time.Time + UpdatedUnix int64 + UserID int64 + func GetRepositoryByName(user string, name string) (*Gitxt, error) + func (gitxt *Gitxt) AfterSet(colName string, _ xorm.Cell) + func (gitxt *Gitxt) BeforeInsert() + func (gitxt *Gitxt) BeforeUpdate() + type GitxtOptions struct + GetAll bool + Page int + PageSize int + UserID int64 + WithPrivate bool + type GitxtWithUser struct + func GetGitxts(opts *GitxtOptions) (gitxts []*GitxtWithUser, _ int64, _ error) + type SSHKey struct + Content string + Created time.Time + CreatedUnix int64 + Fingerprint string + ID int64 + Mode int + Name string + Type int + Updated time.Time + UpdatedUnix int64 + UserID int64 + func (sshKey *SSHKey) BeforeInsert() + func (sshKey *SSHKey) BeforeUpdate() + type User struct + Created time.Time + CreatedUnix int64 + Email string + ID int64 + IsActive bool + IsAdmin bool + LowerName string + Password string + Rands string + Salt string + Updated time.Time + UpdatedUnix int64 + UserName string + func GetUserByEmail(email string) (*User, error) + func GetUserByID(id int64) (*User, error) + func GetUserByName(name string) (*User, error) + func UserLogin(username, password string) (*User, error) + func VerifyUserActiveCode(code string) (user *User) + func (user *User) BeforeInsert() + func (user *User) BeforeUpdate() + func (user *User) EncodePasswd() + func (user *User) GenerateActivateCode() string + func (user *User) GenerateEmailActivateCode(email string) string + func (user *User) ValidatePassword(passwd string) bool