Documentation ¶
Index ¶
- Constants
- func ConvertSqlToDbMockExpect(realSql string) string
- type AnyTime
- type ClaDB
- func (p *ClaDB) GetPRsForUser(user *types.UserSignature) (evalInfos []types.EvaluationInfo, err error)
- func (p *ClaDB) HasAuthorSignedTheCla(login, claVersion string) (isSigned bool, foundUserSignature *types.UserSignature, err error)
- func (p *ClaDB) InsertSignature(user *types.UserSignature) error
- func (p *ClaDB) MigrateDB(migrateSourceURL string) (err error)
- func (p *ClaDB) RemovePRsForUsers(usersSigned []types.UserSignature, evalInfo *types.EvaluationInfo) (err error)
- func (p *ClaDB) StorePRAuthorsMissingSignature(evalInfo *types.EvaluationInfo, checkedAt time.Time) (err error)
- type IClaDB
Constants ¶
View Source
const SqlSelectUnsignedUsersForPR = `SELECT count(*) from unsigned_pr, unsigned_user
WHERE unsigned_pr.Id = unsigned_user.UnsignedPRID AND unsigned_pr.Id = $1`
View Source
const SqlSelectUserSignature = `SELECT
LoginName, Email, GivenName, SignedAt, ClaVersion
FROM signatures
WHERE LoginName = $1
AND ClaVersion = $2`
Variables ¶
This section is empty.
Functions ¶
func ConvertSqlToDbMockExpect ¶
ConvertSqlToDbMockExpect takes a "real" sql string and adds escape characters as needed to produce a regex matching string for use with database mock expect calls.
Types ¶
type ClaDB ¶
type ClaDB struct {
// contains filtered or unexported fields
}
func SetupMockDB ¶
SetupMockDB should always be followed by a call to the closeDbFunc, like so:
mock, db, closeDbFunc := SetupMockDB(t) defer closeDbFunc()
func (*ClaDB) GetPRsForUser ¶
func (p *ClaDB) GetPRsForUser(user *types.UserSignature) (evalInfos []types.EvaluationInfo, err error)
func (*ClaDB) HasAuthorSignedTheCla ¶
func (*ClaDB) InsertSignature ¶
func (p *ClaDB) InsertSignature(user *types.UserSignature) error
func (*ClaDB) RemovePRsForUsers ¶
func (p *ClaDB) RemovePRsForUsers(usersSigned []types.UserSignature, evalInfo *types.EvaluationInfo) (err error)
func (*ClaDB) StorePRAuthorsMissingSignature ¶
type IClaDB ¶
type IClaDB interface { InsertSignature(u *types.UserSignature) error HasAuthorSignedTheCla(login, claVersion string) (bool, *types.UserSignature, error) StorePRAuthorsMissingSignature(evalInfo *types.EvaluationInfo, checkedAt time.Time) error GetPRsForUser(*types.UserSignature) ([]types.EvaluationInfo, error) RemovePRsForUsers([]types.UserSignature, *types.EvaluationInfo) error MigrateDB(migrateSourceURL string) error }
Click to show internal directories.
Click to hide internal directories.