Versions in this module Expand all Collapse all v0 v0.2.0 Apr 27, 2019 Changes in this version + var EnableSQLite3 bool + func AssertCount(t testing.TB, bean interface{}, expected interface{}) + func AssertExistsAndLoadBean(t testing.TB, bean interface{}, conditions ...interface{}) interface + func AssertExistsIf(t *testing.T, expected bool, bean interface{}, conditions ...interface{}) + func AssertInt64InRange(t testing.TB, low, high, value int64) + func AssertNotExistsBean(t testing.TB, bean interface{}, conditions ...interface{}) + func AssertSuccessfulInsert(t testing.TB, beans ...interface{}) + func BeanExists(t testing.TB, bean interface{}, conditions ...interface{}) bool + func Cond(query interface{}, args ...interface{}) interface + func CreateUser(u *User) (err error) + func DeleteAccessTokenByID(id, userID int64) error + func GetCount(t testing.TB, bean interface{}, conditions ...interface{}) int + func InitFixtures(helper testfixtures.Helper, dir string) (err error) + func IsErrAccessTokenEmpty(err error) bool + func IsErrAccessTokenNotExist(err error) bool + func IsErrEmailAlreadyUsed(err error) bool + func IsErrShortenNotExist(err error) bool + func IsErrURLExist(err error) bool + func IsErrUserAlreadyExist(err error) bool + func IsErrUserNotExist(err error) bool + func IsUserExist(uid int64, email string) (bool, error) + func LoadFixtures() error + func MainTest(m *testing.M, pathToRoot string) + func NewAccessToken(t *AccessToken) error + func NewEngine() (err error) + func PrepareTestDatabase() error + func PrepareTestEnv(t testing.TB) + func SetEngine() (err error) + func UpdateAccessToken(t *AccessToken) error + func UpdateUser(u *User) error + func UpdateUserCols(u *User, cols ...string) error + type AccessToken struct + CreatedAt time.Time + HasRecentActivity bool + HasUsed bool + ID int64 + Name string + Sha1 string + UpdatedAt time.Time + UserID int64 + func GetAccessTokenBySHA(sha string) (*AccessToken, error) + func (t *AccessToken) AfterLoad() + type Engine interface + Count func(...interface{}) (int64, error) + Decr func(column string, arg ...interface{}) *xorm.Session + Delete func(interface{}) (int64, error) + Exec func(...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 + Incr func(column string, arg ...interface{}) *xorm.Session + Insert func(...interface{}) (int64, error) + InsertOne func(interface{}) (int64, error) + Iterate func(interface{}, xorm.IterFunc) error + Join func(joinOperator string, tablename interface{}, condition string, ...) *xorm.Session + SQL func(interface{}, ...interface{}) *xorm.Session + Table func(tableNameOrBean interface{}) *xorm.Session + Where func(interface{}, ...interface{}) *xorm.Session + type ErrAccessTokenEmpty struct + func (err ErrAccessTokenEmpty) Error() string + type ErrAccessTokenNotExist struct + SHA string + func (err ErrAccessTokenNotExist) Error() string + type ErrEmailAlreadyUsed struct + Email string + func (err ErrEmailAlreadyUsed) Error() string + type ErrShortenNotExist struct + Slug string + func (err ErrShortenNotExist) Error() string + type ErrURLExist struct + Slug string + URL string + func (err ErrURLExist) Error() string + type ErrUserAlreadyExist struct + Name string + func (err ErrUserAlreadyExist) Error() string + type ErrUserNotExist struct + KeyID int64 + Name string + UID int64 + func (err ErrUserNotExist) Error() string + type Shorten struct + CreatedAt time.Time + Date time.Time + Description string + Hits int64 + Image string + Slug string + Title string + Type string + URL string + UpdatedAt time.Time + User *User + UserID int64 + func CreateShorten(url string, size int, user *User) (_ *Shorten, err error) + func GetShortenBySlug(slug string) (*Shorten, error) + func GetShortenFromURL(url string) (*Shorten, error) + func GetShortenURLs(userID int64, page, pageSize int, orderBy string) ([]*Shorten, error) + func (s *Shorten) GetUser() error + func (s *Shorten) UpdateHits(slug string) error + func (s *Shorten) UpdateMetaData() error + type User struct + Avatar string + AvatarEmail string + CreatedAt time.Time + Email string + FullName string + ID int64 + IsActive bool + LastLogin time.Time + Location string + UpdatedAt time.Time + Website string + func GetUserByEmail(email string) (*User, error) + func GetUserByID(id int64) (*User, error) + func (u *User) BeforeInsert() + func (u *User) BeforeUpdate()