Documentation ¶
Index ¶
- Constants
- func ReadConfig(t *testing.T) config.General
- type AuthenticationMock
- func (a *AuthenticationMock) CanRegisterFirst() (bool, error)
- func (a *AuthenticationMock) Login(loginType, identifier string, password []byte) (*model.User, error)
- func (a *AuthenticationMock) RegisterFirst(loginType, userType, id string, secret []byte) (*model.User, error)
- func (a *AuthenticationMock) RegisterOther(JWT, newLoginType, userType, id, groupID string) (*model.User, error)
- func (a *AuthenticationMock) RegisterSelf(loginType, userType, id string, secret []byte) (*model.User, error)
- func (a *AuthenticationMock) RegisterSelfByLockedPhone(userType, devID, number string, secret []byte) (*model.User, error)
- func (a *AuthenticationMock) SendPassResetCode(loginType, toAddr string) (*model.DBTStatus, error)
- func (a *AuthenticationMock) SendVerCode(JWT, loginType, toAddr string) (*model.DBTStatus, error)
- func (a *AuthenticationMock) SetPassword(loginType, userID string, dbt, pass []byte) (*model.VerifLogin, error)
- func (a *AuthenticationMock) UpdateIdentifier(JWT, loginType, newId string) (*model.User, error)
- func (a *AuthenticationMock) UpdatePassword(JWT string, old, newPass []byte) error
- func (a *AuthenticationMock) VerifyAndExtendDBT(lt, usrID string, dbt []byte) (string, error)
- func (a *AuthenticationMock) VerifyDBT(loginType, userID string, dbt []byte) (*model.VerifLogin, error)
- type DBMock
- func (db *DBMock) APIKeysByUserID(userID string, offset, count int64) ([]api.Key, error)
- func (db *DBMock) AddUserToGroupAtomic(tx *sql.Tx, userID, groupID string) error
- func (db *DBMock) DeleteEmailTokensAtomic(tx *sql.Tx, email string) error
- func (db *DBMock) DeletePhoneTokensAtomic(tx *sql.Tx, phone string) error
- func (db *DBMock) EmailTokens(userID string, offset, count int64) ([]model.DBToken, error)
- func (db *DBMock) ExecuteTx(fn func(*sql.Tx) error) error
- func (db *DBMock) GetSMTPConfig(conf interface{}) error
- func (db *DBMock) Group(string) (*model.Group, error)
- func (db *DBMock) GroupByName(string) (*model.Group, error)
- func (db *DBMock) Groups(offset, count int64) ([]model.Group, error)
- func (db *DBMock) HasUsers(grpID string) error
- func (db *DBMock) InsertAPIKey(userID, key string) (*api.Key, error)
- func (db *DBMock) InsertEmailToken(userID, email string, dbt []byte, isUsed bool, expiry time.Time) (*model.DBToken, error)
- func (db *DBMock) InsertEmailTokenAtomic(tx *sql.Tx, userID, email string, dbt []byte, isUsed bool, expiry time.Time) (*model.DBToken, error)
- func (db *DBMock) InsertGroup(name string, acl float32) (*model.Group, error)
- func (db *DBMock) InsertPhoneToken(userID, phone string, dbt []byte, isUsed bool, expiry time.Time) (*model.DBToken, error)
- func (db *DBMock) InsertPhoneTokenAtomic(tx *sql.Tx, userID, phone string, dbt []byte, isUsed bool, expiry time.Time) (*model.DBToken, error)
- func (db *DBMock) InsertUserAtomic(tx *sql.Tx, t model.UserType, g model.Group, password []byte) (*model.User, error)
- func (db *DBMock) InsertUserDeviceAtomic(tx *sql.Tx, userID, devID string) (*model.Device, error)
- func (db *DBMock) InsertUserEmail(userID, email string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) InsertUserEmailAtomic(tx *sql.Tx, userID, email string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) InsertUserFbIDAtomic(tx *sql.Tx, userID, fbID string, verified bool) (*model.Facebook, error)
- func (db *DBMock) InsertUserName(userID, username string) (*model.Username, error)
- func (db *DBMock) InsertUserNameAtomic(tx *sql.Tx, userID, username string) (*model.Username, error)
- func (db *DBMock) InsertUserPhone(userID, phone string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) InsertUserPhoneAtomic(tx *sql.Tx, userID, phone string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) InsertUserType(name string) (*model.UserType, error)
- func (db *DBMock) PhoneTokens(userID string, offset, count int64) ([]model.DBToken, error)
- func (db *DBMock) SetEmailTokenUsedAtomic(tx *sql.Tx, id string) error
- func (db *DBMock) SetPhoneTokenUsedAtomic(tx *sql.Tx, id string) error
- func (db *DBMock) SetUserGroup(userID, groupID string) error
- func (db *DBMock) UpdatePassword(userID string, password []byte) error
- func (db *DBMock) UpdatePasswordAtomic(tx *sql.Tx, userID string, password []byte) error
- func (db *DBMock) UpdateUserEmail(userID, email string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) UpdateUserEmailAtomic(tx *sql.Tx, userID, email string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) UpdateUserPhone(userID, phone string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) UpdateUserPhoneAtomic(tx *sql.Tx, userID, phone string, verified bool) (*model.VerifLogin, error)
- func (db *DBMock) UpdateUsername(userID, username string) (*model.Username, error)
- func (db *DBMock) UpsertSMTPConfig(conf interface{}) error
- func (db *DBMock) User(id string) (*model.User, []byte, error)
- func (db *DBMock) UserByDeviceID(devID string) (*model.User, []byte, error)
- func (db *DBMock) UserByEmail(email string) (*model.User, []byte, error)
- func (db *DBMock) UserByFacebook(facebookID string) (*model.User, error)
- func (db *DBMock) UserByPhone(phone string) (*model.User, []byte, error)
- func (db *DBMock) UserByUsername(username string) (*model.User, []byte, error)
- func (db *DBMock) UserTypeByName(string) (*model.UserType, error)
- func (db *DBMock) Users(q model.UsersQuery, offset, count int64) ([]model.User, error)
- type Entry
- type FacebookMock
- type GeneratorMock
- type GuardMock
- type JWTMock
- type LoggerMock
- func (lg *LoggerMock) Error(args ...interface{})
- func (lg *LoggerMock) Errorf(fmt string, args ...interface{})
- func (lg *LoggerMock) Fatal(args ...interface{})
- func (lg *LoggerMock) Info(args ...interface{})
- func (lg *LoggerMock) Infof(fmt string, args ...interface{})
- func (lg *LoggerMock) PrintLogs(t *testing.T)
- func (lg *LoggerMock) Warn(args ...interface{})
- func (lg *LoggerMock) Warnf(fmt string, args ...interface{})
- func (lg *LoggerMock) WithField(k string, v interface{}) logging.Logger
- func (lg *LoggerMock) WithFields(f map[string]interface{}) logging.Logger
- func (lg *LoggerMock) WithHTTPRequest(r *http.Request) logging.Logger
Constants ¶
View Source
const ( LevelInfo = "Info" LevelWarn = "Warn" LevelError = "Error" LevelFatal = "Fatal" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticationMock ¶
type AuthenticationMock struct { errors.NotImplErrCheck errors.AuthErrCheck errors.ClErrCheck errors.NotFoundErrCheck ExpRegFirstUser *model.User ExpRegFirstErr error ExpRegSelfUser *model.User ExpRegSelfErr error ExpRegSelfBLPUser *model.User ExpRegSelfBLPErr error ExpRegOtherUser *model.User ExpRegOtherErr error ExpUpdIDerUser *model.User ExpUpdIDerErr error ExpLoginUser *model.User ExpLoginErr error ExpSetPassVerLogin *model.VerifLogin ExpSetPassErr error ExpVerDBTVerLogin *model.VerifLogin ExpVerDBTErr error ExpSndVerCodeDBTStts *model.DBTStatus ExpSndVerCodeErr error ExpSndPassRstDBTStts *model.DBTStatus ExpSndPassRstErr error ExpVerExtDBT string ExpVerExtDBTErr error ExpUpdPassErr error ExpCanRegFirst bool ExpCanRegFirstErr error }
func (*AuthenticationMock) CanRegisterFirst ¶
func (a *AuthenticationMock) CanRegisterFirst() (bool, error)
func (*AuthenticationMock) RegisterFirst ¶
func (*AuthenticationMock) RegisterOther ¶
func (a *AuthenticationMock) RegisterOther(JWT, newLoginType, userType, id, groupID string) (*model.User, error)
func (*AuthenticationMock) RegisterSelf ¶
func (*AuthenticationMock) RegisterSelfByLockedPhone ¶
func (*AuthenticationMock) SendPassResetCode ¶
func (a *AuthenticationMock) SendPassResetCode(loginType, toAddr string) (*model.DBTStatus, error)
func (*AuthenticationMock) SendVerCode ¶
func (a *AuthenticationMock) SendVerCode(JWT, loginType, toAddr string) (*model.DBTStatus, error)
func (*AuthenticationMock) SetPassword ¶
func (a *AuthenticationMock) SetPassword(loginType, userID string, dbt, pass []byte) (*model.VerifLogin, error)
func (*AuthenticationMock) UpdateIdentifier ¶
func (a *AuthenticationMock) UpdateIdentifier(JWT, loginType, newId string) (*model.User, error)
func (*AuthenticationMock) UpdatePassword ¶
func (a *AuthenticationMock) UpdatePassword(JWT string, old, newPass []byte) error
func (*AuthenticationMock) VerifyAndExtendDBT ¶
func (a *AuthenticationMock) VerifyAndExtendDBT(lt, usrID string, dbt []byte) (string, error)
func (*AuthenticationMock) VerifyDBT ¶
func (a *AuthenticationMock) VerifyDBT(loginType, userID string, dbt []byte) (*model.VerifLogin, error)
type DBMock ¶
type DBMock struct { errors.NotFoundErrCheck ExpInsGrpErr error ExpGrpBNm *model.Group ExpGrpBNmErr error ExpGrp *model.Group ExpGrpErr error ExpGrps []model.Group ExpGrpsErr error ExpSetUsrGrpErr error ExpInsUsrTypErr error ExpUsrTypBNm *model.UserType ExpUsrTypBNmErr error ExpInsUsrErr error ExpInsUsrAtmErr error ExpUsr *model.User ExpUsrErr error ExpUsrBPhn *model.User ExpUsrBPhnErr error ExpUsrBMail *model.User ExpUsrBMailErr error ExpUsrBUsrNm *model.User ExpUsrBUsrNmErr error ExpUsrBFb *model.User ExpUsrBFbErr error ExpUsrBDev *model.User ExpUsrBDevErr error ExpUsrs []model.User ExpUsrsErr error ExpupdPassErr error ExpupdPassAtmErr error ExpUsrPass []byte ExpUsrBDevPass []byte ExpUsrBUsrNmPass []byte ExpUsrBPhnPass []byte ExpUsrBMailPass []byte ExpInsAPIKErr error ExpAPIKsBUsrID []api.Key ExpAPIKsBUsrIDErr error ExpAddUsrTGrpAtmcErr error ExpInsDevAtmErr error ExpInsUsrNmErr error ExpInsUsrNmAtmErr error ExpUpdUsrNm *model.Username ExpUpdUsrNmErr error ExpInsUsrPhnErr error ExpInsUsrPhnAtmErr error ExpUpdUsrPhn *model.VerifLogin ExpUpdUsrPhnErr error ExpUpdUsrPhnAtm *model.VerifLogin ExpUpdUsrPhnAtmErr error ExpInsPhnTknErr error ExpInsPhnTknAtmErr error ExpPhnTkns []model.DBToken ExpPhnTknsErr error ExpDelPhnTknsErr error ExpSetPhnTknUsdErr error ExpInsUsrMailErr error ExpInsUsrMailAtmErr error ExpUpdUsrMail *model.VerifLogin ExpUpdUsrMailErr error ExpUpdUsrMailAtm *model.VerifLogin ExpUpdUsrMailAtmErr error ExpInsMailTknErr error ExpInsMailTknAtmErr error ExpMailTkns []model.DBToken ExpMailTknsErr error ExpDelMailTknsErr error ExpSetMailTknUsdErr error ExpInsFbAtmErr error ExpUpsSMTPConfErr error ExpSMTPConf smtp.Config ExpSMTPConfErr error ExpHasUsrsErr error // contains filtered or unexported fields }
func (*DBMock) APIKeysByUserID ¶
func (*DBMock) AddUserToGroupAtomic ¶
func (*DBMock) DeleteEmailTokensAtomic ¶
func (*DBMock) DeletePhoneTokensAtomic ¶
func (*DBMock) EmailTokens ¶
func (*DBMock) GetSMTPConfig ¶
func (*DBMock) InsertEmailToken ¶
func (*DBMock) InsertEmailTokenAtomic ¶
func (*DBMock) InsertGroup ¶
func (*DBMock) InsertPhoneToken ¶
func (*DBMock) InsertPhoneTokenAtomic ¶
func (*DBMock) InsertUserAtomic ¶
func (*DBMock) InsertUserDeviceAtomic ¶
func (*DBMock) InsertUserEmail ¶
func (*DBMock) InsertUserEmailAtomic ¶
func (*DBMock) InsertUserFbIDAtomic ¶
func (*DBMock) InsertUserName ¶
func (*DBMock) InsertUserNameAtomic ¶
func (*DBMock) InsertUserPhone ¶
func (*DBMock) InsertUserPhoneAtomic ¶
func (*DBMock) InsertUserType ¶
func (*DBMock) PhoneTokens ¶
func (*DBMock) SetEmailTokenUsedAtomic ¶
func (*DBMock) SetPhoneTokenUsedAtomic ¶
func (*DBMock) SetUserGroup ¶
func (*DBMock) UpdatePassword ¶
func (*DBMock) UpdatePasswordAtomic ¶
func (*DBMock) UpdateUserEmail ¶
func (*DBMock) UpdateUserEmailAtomic ¶
func (*DBMock) UpdateUserPhone ¶
func (*DBMock) UpdateUserPhoneAtomic ¶
func (*DBMock) UpdateUsername ¶
func (*DBMock) UpsertSMTPConfig ¶
func (*DBMock) UserByDeviceID ¶
func (*DBMock) UserByEmail ¶
func (*DBMock) UserByFacebook ¶
func (*DBMock) UserByPhone ¶
func (*DBMock) UserByUsername ¶
type FacebookMock ¶
type FacebookMock struct { errors.AuthErrCheck ExpValTknErr error }
func (*FacebookMock) ValidateToken ¶
func (f *FacebookMock) ValidateToken(token string) (string, error)
type GeneratorMock ¶
func (*GeneratorMock) SecureRandomBytes ¶
func (kg *GeneratorMock) SecureRandomBytes(length int) ([]byte, error)
type GuardMock ¶
type LoggerMock ¶
type LoggerMock struct { Fields map[string]interface{} Logs []Entry Spinoffs []*LoggerMock HTTPReq *http.Request }
func (*LoggerMock) Error ¶
func (lg *LoggerMock) Error(args ...interface{})
func (*LoggerMock) Errorf ¶
func (lg *LoggerMock) Errorf(fmt string, args ...interface{})
func (*LoggerMock) Fatal ¶
func (lg *LoggerMock) Fatal(args ...interface{})
func (*LoggerMock) Info ¶
func (lg *LoggerMock) Info(args ...interface{})
func (*LoggerMock) Infof ¶
func (lg *LoggerMock) Infof(fmt string, args ...interface{})
func (*LoggerMock) PrintLogs ¶
func (lg *LoggerMock) PrintLogs(t *testing.T)
func (*LoggerMock) Warn ¶
func (lg *LoggerMock) Warn(args ...interface{})
func (*LoggerMock) Warnf ¶
func (lg *LoggerMock) Warnf(fmt string, args ...interface{})
func (*LoggerMock) WithField ¶
func (lg *LoggerMock) WithField(k string, v interface{}) logging.Logger
func (*LoggerMock) WithFields ¶
func (lg *LoggerMock) WithFields(f map[string]interface{}) logging.Logger
func (*LoggerMock) WithHTTPRequest ¶
func (lg *LoggerMock) WithHTTPRequest(r *http.Request) logging.Logger
Click to show internal directories.
Click to hide internal directories.