Documentation ¶
Index ¶
- Constants
- func NewPoll() types.Poll
- func PollConvertSqlToDbMockExpect(realSql string) string
- func SetupMockPollSelect(mock sqlmock.Sqlmock, pollId string, now time.Time)
- func SetupMockPollSelectAndUpdate(mock sqlmock.Sqlmock, pollId string, now time.Time, rowsAffected int64)
- func SetupMockPollSelectAndUpdateAnyUpdateTime(mock sqlmock.Sqlmock, pollId string, now time.Time, rowsAffected int64)
- func SetupMockPollSelectForcedError(mock sqlmock.Sqlmock, forcedError error, pollId string)
- type BBashDB
- func (p *BBashDB) DeleteOrganization(scpName, orgName string) (rowsAffected int64, err error)
- func (p *BBashDB) DeleteParticipant(campaign, scpName, loginName string) (participantId string, err error)
- func (p *BBashDB) GetActiveCampaigns(now time.Time) (activeCampaigns []types.CampaignStruct, err error)
- func (p *BBashDB) GetCampaign(campaignName string) (campaign *types.CampaignStruct, err error)
- func (p *BBashDB) GetCampaigns() (campaigns []types.CampaignStruct, err error)
- func (p *BBashDB) GetDb() (db *sql.DB)
- func (p *BBashDB) GetOrganizations() (organizations []types.OrganizationStruct, err error)
- func (p *BBashDB) GetSourceControlProviders() (scps []types.SourceControlProviderStruct, err error)
- func (p *BBashDB) InsertBug(bug *types.BugStruct) (err error)
- func (p *BBashDB) InsertCampaign(campaign *types.CampaignStruct) (guid string, err error)
- func (p *BBashDB) InsertOrganization(organization *types.OrganizationStruct) (guid string, err error)
- func (p *BBashDB) InsertParticipant(participant *types.ParticipantStruct) (err error)
- func (p *BBashDB) InsertScoringEvent(participantToScore *types.ParticipantStruct, msg *types.ScoringMessage, ...) (err error)
- func (p *BBashDB) InsertTeam(team *types.TeamStruct) (err error)
- func (p *BBashDB) MigrateDB(migrateSourceURL string) (err error)
- func (p *BBashDB) SelectBugs() (bugs []types.BugStruct, err error)
- func (p *BBashDB) SelectParticipantDetail(campaignName, scpName, loginName string) (participant *types.ParticipantStruct, err error)
- func (p *BBashDB) SelectParticipantsInCampaign(campaignName string) (participants []types.ParticipantStruct, err error)
- func (p *BBashDB) SelectParticipantsToScore(msg *types.ScoringMessage, now time.Time) (participantsToScore []types.ParticipantStruct, err error)
- func (p *BBashDB) SelectPointValue(msg *types.ScoringMessage, campaignName, bugType string) (pointValue float64)
- func (p *BBashDB) SelectPriorScore(participantToScore *types.ParticipantStruct, msg *types.ScoringMessage) (oldPoints float64)
- func (p *BBashDB) UpdateBug(bug *types.BugStruct) (rowsAffected int64, err error)
- func (p *BBashDB) UpdateCampaign(campaign *types.CampaignStruct) (guid string, err error)
- func (p *BBashDB) UpdateParticipant(participant *types.ParticipantStruct) (rowsAffected int64, err error)
- func (p *BBashDB) UpdateParticipantScore(participant *types.ParticipantStruct, delta float64) (err error)
- func (p *BBashDB) UpdateParticipantTeam(teamName, campaignName, scpName, loginName string) (rowsAffected int64, err error)
- func (p *BBashDB) ValidOrganization(msg *types.ScoringMessage) (orgExists bool, err error)
- type IBBashDB
- type IDBPoll
- type IScoreDB
- type PollStruct
Constants ¶
View Source
const PollId = "1"
PollId there can be only one
View Source
const TestEventSourceValid = "github"
TestEventSourceValid EventSource is lower case to match case sent by loggly
View Source
const TestOrgValid = "myValidTestOrganization"
Variables ¶
This section is empty.
Functions ¶
func PollConvertSqlToDbMockExpect ¶
PollConvertSqlToDbMockExpect exposed for poll package tests
func SetupMockPollSelect ¶
Types ¶
type BBashDB ¶
type BBashDB 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 (*BBashDB) DeleteOrganization ¶
func (*BBashDB) DeleteParticipant ¶
func (*BBashDB) GetActiveCampaigns ¶
func (*BBashDB) GetCampaign ¶
func (p *BBashDB) GetCampaign(campaignName string) (campaign *types.CampaignStruct, err error)
func (*BBashDB) GetCampaigns ¶
func (p *BBashDB) GetCampaigns() (campaigns []types.CampaignStruct, err error)
func (*BBashDB) GetOrganizations ¶
func (p *BBashDB) GetOrganizations() (organizations []types.OrganizationStruct, err error)
func (*BBashDB) GetSourceControlProviders ¶
func (p *BBashDB) GetSourceControlProviders() (scps []types.SourceControlProviderStruct, err error)
func (*BBashDB) InsertCampaign ¶
func (p *BBashDB) InsertCampaign(campaign *types.CampaignStruct) (guid string, err error)
func (*BBashDB) InsertOrganization ¶
func (p *BBashDB) InsertOrganization(organization *types.OrganizationStruct) (guid string, err error)
func (*BBashDB) InsertParticipant ¶
func (p *BBashDB) InsertParticipant(participant *types.ParticipantStruct) (err error)
func (*BBashDB) InsertScoringEvent ¶
func (p *BBashDB) InsertScoringEvent(participantToScore *types.ParticipantStruct, msg *types.ScoringMessage, newPoints float64) (err error)
func (*BBashDB) InsertTeam ¶
func (p *BBashDB) InsertTeam(team *types.TeamStruct) (err error)
func (*BBashDB) SelectParticipantDetail ¶
func (p *BBashDB) SelectParticipantDetail(campaignName, scpName, loginName string) (participant *types.ParticipantStruct, err error)
func (*BBashDB) SelectParticipantsInCampaign ¶
func (p *BBashDB) SelectParticipantsInCampaign(campaignName string) (participants []types.ParticipantStruct, err error)
func (*BBashDB) SelectParticipantsToScore ¶
func (p *BBashDB) SelectParticipantsToScore(msg *types.ScoringMessage, now time.Time) (participantsToScore []types.ParticipantStruct, err error)
func (*BBashDB) SelectPointValue ¶
func (p *BBashDB) SelectPointValue(msg *types.ScoringMessage, campaignName, bugType string) (pointValue float64)
func (*BBashDB) SelectPriorScore ¶
func (p *BBashDB) SelectPriorScore(participantToScore *types.ParticipantStruct, msg *types.ScoringMessage) (oldPoints float64)
func (*BBashDB) UpdateCampaign ¶
func (p *BBashDB) UpdateCampaign(campaign *types.CampaignStruct) (guid string, err error)
func (*BBashDB) UpdateParticipant ¶
func (p *BBashDB) UpdateParticipant(participant *types.ParticipantStruct) (rowsAffected int64, err error)
func (*BBashDB) UpdateParticipantScore ¶
func (p *BBashDB) UpdateParticipantScore(participant *types.ParticipantStruct, delta float64) (err error)
func (*BBashDB) UpdateParticipantTeam ¶
func (*BBashDB) ValidOrganization ¶
func (p *BBashDB) ValidOrganization(msg *types.ScoringMessage) (orgExists bool, err error)
type IBBashDB ¶
type IBBashDB interface { MigrateDB(migrateSourceURL string) error GetSourceControlProviders() (scps []types.SourceControlProviderStruct, err error) InsertCampaign(campaign *types.CampaignStruct) (guid string, err error) UpdateCampaign(campaign *types.CampaignStruct) (guid string, err error) GetCampaign(campaignName string) (campaign *types.CampaignStruct, err error) GetCampaigns() (campaigns []types.CampaignStruct, err error) GetActiveCampaigns(now time.Time) (activeCampaigns []types.CampaignStruct, err error) InsertOrganization(organization *types.OrganizationStruct) (guid string, err error) GetOrganizations() (organizations []types.OrganizationStruct, err error) DeleteOrganization(scpName, orgName string) (rowsAffected int64, err error) ValidOrganization(msg *types.ScoringMessage) (orgExists bool, err error) SelectParticipantsToScore(msg *types.ScoringMessage, now time.Time) (participantsToScore []types.ParticipantStruct, err error) SelectPointValue(msg *types.ScoringMessage, campaignName, bugType string) (pointValue float64) IScoreDB InsertParticipant(participant *types.ParticipantStruct) (err error) SelectParticipantDetail(campaignName, scpName, loginName string) (participant *types.ParticipantStruct, err error) SelectParticipantsInCampaign(campaignName string) (participants []types.ParticipantStruct, err error) UpdateParticipant(participant *types.ParticipantStruct) (rowsAffected int64, err error) DeleteParticipant(campaign, scpName, loginName string) (participantId string, err error) UpdateParticipantTeam(teamName, campaignName, scpName, loginName string) (rowsAffected int64, err error) InsertTeam(team *types.TeamStruct) (err error) InsertBug(bug *types.BugStruct) (err error) UpdateBug(bug *types.BugStruct) (rowsAffected int64, err error) SelectBugs() (bugs []types.BugStruct, err error) }
type IScoreDB ¶
type IScoreDB interface { GetDb() (db *sql.DB) SelectPriorScore(participantToScore *types.ParticipantStruct, msg *types.ScoringMessage) (oldPoints float64) InsertScoringEvent(participantToScore *types.ParticipantStruct, msg *types.ScoringMessage, newPoints float64) (err error) UpdateParticipantScore(participant *types.ParticipantStruct, delta float64) (err error) }
type PollStruct ¶
type PollStruct struct {
// contains filtered or unexported fields
}
func SetupMockDBPoll ¶
func SetupMockDBPoll(t *testing.T) (mock sqlmock.Sqlmock, mockDbPoll *PollStruct, closeDbFunc func())
SetupMockDBPoll should always be followed by a call to the closeDbFunc, like so:
mock, db, closeDbFunc := SetupMockDBPoll(t) defer closeDbFunc()
func (*PollStruct) GetLogger ¶
func (p *PollStruct) GetLogger() *zap.Logger
func (*PollStruct) NewPoll ¶
func (p *PollStruct) NewPoll() types.Poll
func (*PollStruct) SelectPoll ¶
func (p *PollStruct) SelectPoll(poll *types.Poll) (err error)
func (*PollStruct) UpdatePoll ¶
func (p *PollStruct) UpdatePoll(poll *types.Poll) (err error)
Click to show internal directories.
Click to hide internal directories.