mongo

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// URI is the mongo database's URI connection string
	URI string `envconfig:"MONGO_URI" required:"true"`
}

Config is the configuration required to connect to the mongo DB

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

func New

func New(url string) (*Mongo, error)

func (*Mongo) AddOrganisation

func (m *Mongo) AddOrganisation(name string) (impact.Organisation, error)

func (*Mongo) CompleteMeeting

func (m *Mongo) CompleteMeeting(meetingID string, u auth.User) (impact.Meeting, error)

func (*Mongo) DeleteCategory

func (m *Mongo) DeleteCategory(outcomeSetID string, categoryID string, u auth.User) error

func (*Mongo) DeleteMeeting

func (m *Mongo) DeleteMeeting(meetingID string, u auth.User) error

func (*Mongo) DeleteOrganisation

func (m *Mongo) DeleteOrganisation(id string) error

func (*Mongo) DeleteOutcomeSet

func (m *Mongo) DeleteOutcomeSet(id string, u auth.User) error

func (*Mongo) DeleteQuestion

func (m *Mongo) DeleteQuestion(outcomeSetID string, questionID string, u auth.User) error

func (*Mongo) EditCategory

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

func (*Mongo) EditMeetingBeneficiary

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

func (*Mongo) EditMeetingDate

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

func (*Mongo) EditMeetingTags

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

func (*Mongo) EditOutcomeSet

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

func (*Mongo) EditQuestion

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

func (*Mongo) GetBeneficiaries

func (m *Mongo) GetBeneficiaries(u auth.User) ([]string, error)

func (*Mongo) GetBeneficiary

func (m *Mongo) GetBeneficiary(id string, u auth.User) (impact.Beneficiary, error)

func (*Mongo) GetCategory

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

func (*Mongo) GetExport

func (m *Mongo) GetExport(id string) (*impact.Export, error)

func (*Mongo) GetFilteredOSMeetingsForBeneficiaries

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

func (*Mongo) GetFilteredOSMeetingsInTimeRange

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

func (*Mongo) GetIncompleteMeetingsForBeneficiary

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

func (*Mongo) GetInvite

func (m *Mongo) GetInvite(id string) (string, error)

func (*Mongo) GetJWT

func (m *Mongo) GetJWT(jti string) (string, error)

func (*Mongo) GetMeeting

func (m *Mongo) GetMeeting(id string, u auth.User) (impact.Meeting, error)

func (*Mongo) GetMeetingsForBeneficiary

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

func (*Mongo) GetOSMeetingsForBeneficiary

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

func (*Mongo) GetOSMeetingsInTimeRange

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

func (*Mongo) GetOrganisation

func (m *Mongo) GetOrganisation(id string) (impact.Organisation, error)

func (*Mongo) GetOrganisations

func (m *Mongo) GetOrganisations(offset int, limit int) ([]impact.Organisation, error)

func (*Mongo) GetOutcomeSet

func (m *Mongo) GetOutcomeSet(id string, u auth.User) (impact.OutcomeSet, error)

func (*Mongo) GetOutcomeSets

func (m *Mongo) GetOutcomeSets(u auth.User) ([]impact.OutcomeSet, error)

func (*Mongo) GetQuestion

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

func (*Mongo) GetQuestionnaireTagSuggestions

func (m *Mongo) GetQuestionnaireTagSuggestions(qID string, u auth.User) ([]string, error)

func (*Mongo) GetRecentMeetings

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

func (*Mongo) GetTagSuggestions

func (m *Mongo) GetTagSuggestions(beneficiary string, u auth.User) ([]string, error)

func (*Mongo) GetTags

func (m *Mongo) GetTags(u auth.User) ([]string, error)

func (*Mongo) HasGeneratedReport

func (m *Mongo) HasGeneratedReport(orgID string) (bool, error)

func (*Mongo) ImportOutcomeSet

func (m *Mongo) ImportOutcomeSet(os impact.OutcomeSet, u auth.User) (impact.OutcomeSet, error)

func (*Mongo) MoveQuestion

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

func (*Mongo) NewAnswer

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

func (*Mongo) NewCategory

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

func (*Mongo) NewMeeting

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

func (*Mongo) NewMeetingFromSummon

func (m *Mongo) NewMeetingFromSummon(summon string, beneficiaryID string) (string, impact.Summon, error)

func (*Mongo) NewOutcomeSet

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

func (*Mongo) NewQuestion

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

func (*Mongo) NewSummon

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

func (*Mongo) RemoveCategory

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

func (*Mongo) SaveExport

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

func (*Mongo) SaveInvite

func (m *Mongo) SaveInvite(ttl time.Duration, u auth.User) (string, error)

func (*Mongo) SaveJWT

func (m *Mongo) SaveJWT(jti string, jwt string, creatorUserID string) error

func (*Mongo) SaveReportRequest

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

func (*Mongo) SaveSummonAcceptance

func (m *Mongo) SaveSummonAcceptance(beneficiaryID string, summonID string, meetingID string, jti string, org string) error

func (*Mongo) SetBeneficiaryTags

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

func (*Mongo) SetCategory

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

func (*Mongo) SetNotes

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

func (*Mongo) UpdateSetting

func (m *Mongo) UpdateSetting(orgID string, setting string, value interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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