session

package
v0.0.0-...-f2e39e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S

type S struct {
	*mgo.Session
}

S is a mongo session

func (*S) AddOrganisation

func (s *S) AddOrganisation(name string) (impact.Organisation, error)

func (*S) CompleteMeeting

func (s *S) CompleteMeeting(meetingID string, u auth.User) (impact.Meeting, error)

func (*S) DeleteCategory

func (s *S) DeleteCategory(outcomeSetID, categoryID string, u auth.User) error

func (*S) DeleteMeeting

func (s *S) DeleteMeeting(meetingID string, u auth.User) error

func (*S) DeleteOrganisation

func (s *S) DeleteOrganisation(id string) error

func (*S) DeleteOutcomeSet

func (s *S) DeleteOutcomeSet(id string, u auth.User) error

func (*S) DeleteQuestion

func (s *S) DeleteQuestion(outcomeSetID, questionID string, u auth.User) error

func (*S) EditCategory

func (s *S) EditCategory(outcomeSetID, categoryID string, name, description string, aggregation impact.Aggregation, u auth.User) (impact.Category, error)

func (*S) EditMeetingBeneficiary

func (s *S) EditMeetingBeneficiary(meetingID, newBenID string, u auth.User) (impact.Meeting, error)

func (*S) EditMeetingDate

func (s *S) EditMeetingDate(meetingID string, conducted time.Time, u auth.User) (impact.Meeting, error)

func (*S) EditMeetingTags

func (s *S) EditMeetingTags(meetingID string, newTags []string, u auth.User) (impact.Meeting, error)

func (*S) EditOutcomeSet

func (s *S) EditOutcomeSet(id, name, description, instructions string, skippable bool, u auth.User) (impact.OutcomeSet, error)

func (*S) EditQuestion

func (s *S) EditQuestion(outcomeSetID, questionID, question, short, description string, questionType impact.QuestionType, options map[string]interface{}, u auth.User) (impact.Question, error)

func (*S) EnsureIndexes

func (s *S) EnsureIndexes() error

EnsureIndexes creates the required indexes on the mongo database

func (*S) GetBeneficiaries

func (s *S) GetBeneficiaries(u auth.User) ([]string, error)

func (*S) GetBeneficiary

func (s *S) GetBeneficiary(id string, u auth.User) (impact.Beneficiary, error)

GetBeneficiary gets a beneficiary's details. Beneficiary information is optional, as such, we first check the beneficiary collection then fall back to see if the beneficiary has registered meetings.

func (*S) GetCategory

func (s *S) GetCategory(outcomeSetID, categoryID string, u auth.User) (impact.Category, error)

func (*S) GetExport

func (s *S) GetExport(id string) (*impact.Export, error)

func (*S) GetFilteredOSMeetingsForBeneficiaries

func (s *S) GetFilteredOSMeetingsForBeneficiaries(beneficiaries []string, outcomeSetID string, tags []string, or bool, u auth.User) ([]impact.Meeting, error)

func (*S) GetFilteredOSMeetingsInTimeRange

func (s *S) GetFilteredOSMeetingsInTimeRange(start, end time.Time, outcomeSetID string, tags []string, or bool, u auth.User) ([]impact.Meeting, error)

func (*S) GetIncompleteMeetingsForBeneficiary

func (s *S) GetIncompleteMeetingsForBeneficiary(beneficiary string, u auth.User) ([]impact.Meeting, error)

func (*S) GetInvite

func (s *S) GetInvite(id string) (string, error)

func (*S) GetJWT

func (s *S) GetJWT(jti string) (string, error)

func (*S) GetMeeting

func (s *S) GetMeeting(id string, u auth.User) (impact.Meeting, error)

func (*S) GetMeetingsForBeneficiary

func (s *S) GetMeetingsForBeneficiary(beneficiary string, u auth.User) ([]impact.Meeting, error)

func (*S) GetOSMeetingsForBeneficiary

func (s *S) GetOSMeetingsForBeneficiary(beneficiary string, outcomeSetID string, u auth.User) ([]impact.Meeting, error)

func (*S) GetOSMeetingsInTimeRange

func (s *S) GetOSMeetingsInTimeRange(start, end time.Time, outcomeSetID string, u auth.User) ([]impact.Meeting, error)

func (*S) GetOrganisation

func (s *S) GetOrganisation(id string) (impact.Organisation, error)

func (*S) GetOrganisations

func (s *S) GetOrganisations(offset, limit int) ([]impact.Organisation, error)

func (*S) GetOutcomeSet

func (s *S) GetOutcomeSet(id string, u auth.User) (impact.OutcomeSet, error)

func (*S) GetOutcomeSets

func (s *S) GetOutcomeSets(u auth.User) ([]impact.OutcomeSet, error)

func (*S) GetQuestion

func (s *S) GetQuestion(outcomeSetID string, questionID string, u auth.User) (impact.Question, error)

func (*S) GetQuestionnaireTagSuggestions

func (s *S) GetQuestionnaireTagSuggestions(qID string, u auth.User) ([]string, error)

func (*S) GetRecentMeetings

func (s *S) GetRecentMeetings(limit, page int, u auth.User) ([]impact.Meeting, error)

func (*S) GetTagSuggestions

func (s *S) GetTagSuggestions(beneficiary string, u auth.User) ([]string, error)

func (*S) GetTags

func (s *S) GetTags(u auth.User) ([]string, error)

func (*S) HasGeneratedReport

func (s *S) HasGeneratedReport(orgID string) (bool, error)

func (*S) ImportOutcomeSet

func (s *S) ImportOutcomeSet(os impact.OutcomeSet, u auth.User) (impact.OutcomeSet, error)

func (*S) MoveQuestion

func (s *S) MoveQuestion(outcomeSetID, questionID string, newIndex uint, u auth.User) error

func (*S) NewAnswer

func (s *S) NewAnswer(meetingID string, answer impact.Answer, allowOverwrite bool, u auth.User) (impact.Meeting, error)

func (*S) NewCategory

func (s *S) NewCategory(outcomeSetID, name, description string, aggregation impact.Aggregation, u auth.User) (impact.Category, error)

func (*S) NewMeeting

func (s *S) NewMeeting(beneficiaryID, outcomeSetID string, conducted time.Time, tags []string, u auth.User) (impact.Meeting, error)

func (*S) NewMeetingFromSummon

func (s *S) NewMeetingFromSummon(summonID string, beneficiaryID string) (string, impact.Summon, error)

func (*S) NewOutcomeSet

func (s *S) NewOutcomeSet(name, description, instructions string, skippable bool, u auth.User) (impact.OutcomeSet, error)

func (*S) NewQuestion

func (s *S) NewQuestion(outcomeSetID, question, short, description string, questionType impact.QuestionType, options map[string]interface{}, u auth.User) (impact.Question, error)

func (*S) NewSummon

func (s *S) NewSummon(questionnaire string, ttl time.Duration, u auth.User) (string, error)

func (*S) RemoveCategory

func (s *S) RemoveCategory(outcomeSetID, questionID string, u auth.User) (impact.Question, error)

func (*S) SaveExport

func (s *S) SaveExport(e *impact.Export, ttl time.Duration, u auth.User) (string, error)

func (*S) SaveInvite

func (s *S) SaveInvite(ttl time.Duration, u auth.User) (string, error)

func (*S) SaveJWT

func (s *S) SaveJWT(jti, jwt, creatorUserID string) error

func (*S) SaveReportRequest

func (s *S) SaveReportRequest(start, end time.Time, qID string, tags []string, other map[string]interface{}, u auth.User) error

func (*S) SaveSummonAcceptance

func (s *S) SaveSummonAcceptance(beneficiaryID string, summonID string, meetingID string, jti string, org string) error

func (*S) SetBeneficiaryTags

func (s *S) SetBeneficiaryTags(id string, tags []string, u auth.User) (impact.Beneficiary, error)

func (*S) SetCategory

func (s *S) SetCategory(outcomeSetID, questionID, categoryID string, u auth.User) (impact.Question, error)

func (*S) SetNotes

func (s *S) SetNotes(meetingID string, notes *string, u auth.User) (impact.Meeting, error)

func (*S) UpdateSetting

func (s *S) UpdateSetting(orgID, setting string, value interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL