data

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExpired

func IsExpired(err error) bool

IsExpired returns true if the error was due to a resource being expired

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error was due to a resource not being found

func NewExpiredError

func NewExpiredError(thing string) error

NewExpiredError returns an error to be used when resources have expired due to a TTL

func NewNotFoundError

func NewNotFoundError(thing string) error

NewNotFoundError return an error to be used when request to fetch / update / delete an individual element fails because the element does not exist.

Types

type Base

type Base interface {
	NewOutcomeSet(name string, description string, instructions string, skippable bool, u auth.User) (impact.OutcomeSet, error)
	ImportOutcomeSet(os impact.OutcomeSet, u auth.User) (impact.OutcomeSet, error)
	EditOutcomeSet(id string, name string, description string, instructions string, skippable bool, u auth.User) (impact.OutcomeSet, error)
	GetOutcomeSet(id string, u auth.User) (impact.OutcomeSet, error)
	GetOutcomeSets(u auth.User) ([]impact.OutcomeSet, error)
	DeleteOutcomeSet(id string, u auth.User) error

	GetQuestion(outcomeSetID string, questionID string, u auth.User) (impact.Question, error)
	NewQuestion(outcomeSetID string, question string, short string, description string, questionType impact.QuestionType, options map[string]interface{}, u auth.User) (impact.Question, error)
	DeleteQuestion(outcomeSetID string, questionID string, u auth.User) error
	EditQuestion(outcomeSetID string, questionID string, question string, short string, description string, questionType impact.QuestionType, options map[string]interface{}, u auth.User) (impact.Question, error)
	MoveQuestion(outcomeSetID string, questionID string, newIndex uint, u auth.User) error

	GetCategory(outcomeSetID string, categoryID string, u auth.User) (impact.Category, error)
	NewCategory(outcomeSetID string, name string, description string, aggregation impact.Aggregation, u auth.User) (impact.Category, error)
	DeleteCategory(outcomeSetID string, categoryID string, u auth.User) error
	EditCategory(outcomeSetID string, categoryID string, name string, description string, aggregation impact.Aggregation, u auth.User) (impact.Category, error)
	SetCategory(outcomeSetID string, questionID string, categoryID string, u auth.User) (impact.Question, error)
	RemoveCategory(outcomeSetID string, questionID string, u auth.User) (impact.Question, error)

	GetOrganisation(id string) (impact.Organisation, error)
	AddOrganisation(name string) (impact.Organisation, error)
	DeleteOrganisation(id string) error
	UpdateSetting(orgID string, setting string, value interface{}) error
	GetOrganisations(offset int, limit int) ([]impact.Organisation, error)

	GetMeeting(id string, u auth.User) (impact.Meeting, error)
	GetMeetingsForBeneficiary(beneficiary string, u auth.User) ([]impact.Meeting, error)
	GetRecentMeetings(limit int, page int, u auth.User) ([]impact.Meeting, error)
	GetIncompleteMeetingsForBeneficiary(beneficiary string, u auth.User) ([]impact.Meeting, error)
	GetOSMeetingsInTimeRange(start time.Time, end time.Time, outcomeSetID string, u auth.User) ([]impact.Meeting, error)
	GetOSMeetingsForBeneficiary(beneficiary string, outcomeSetID string, u auth.User) ([]impact.Meeting, error)
	GetFilteredOSMeetingsInTimeRange(start time.Time, end time.Time, outcomeSetID string, tags []string, or bool, u auth.User) ([]impact.Meeting, error)
	GetFilteredOSMeetingsForBeneficiaries(beneficiaries []string, outcomeSetID string, tags []string, or bool, u auth.User) ([]impact.Meeting, error)

	NewMeeting(beneficiaryID string, outcomeSetID string, conducted time.Time, tags []string, u auth.User) (impact.Meeting, error)
	NewAnswer(meetingID string, answer impact.Answer, allowOverwrite bool, u auth.User) (impact.Meeting, error)
	SetNotes(meetingID string, notes *string, u auth.User) (impact.Meeting, error)
	CompleteMeeting(meetingID string, u auth.User) (impact.Meeting, error)
	DeleteMeeting(meetingID string, u auth.User) error
	EditMeetingTags(meetingID string, newTags []string, u auth.User) (impact.Meeting, error)
	EditMeetingDate(meetingID string, conducted time.Time, u auth.User) (impact.Meeting, error)
	EditMeetingBeneficiary(meetingID string, newBenID string, u auth.User) (impact.Meeting, error)
	NewSummon(questionnaire string, ttl time.Duration, u auth.User) (string, error)
	NewMeetingFromSummon(summon string, beneficiaryID string) (string, impact.Summon, error)

	GetTags(u auth.User) ([]string, error)
	GetTagSuggestions(beneficiary string, u auth.User) ([]string, error)
	GetQuestionnaireTagSuggestions(qID string, u auth.User) ([]string, error)

	GetBeneficiary(id string, u auth.User) (impact.Beneficiary, error)
	GetBeneficiaries(u auth.User) ([]string, error)
	SetBeneficiaryTags(id string, tags []string, u auth.User) (impact.Beneficiary, error)

	SaveJWT(jti string, jwt string, creatorUserID string) error
	GetJWT(jti string) (string, error)

	SaveExport(e *impact.Export, ttl time.Duration, u auth.User) (string, error)
	GetExport(id string) (*impact.Export, error)

	SaveInvite(ttl time.Duration, u auth.User) (string, error)
	GetInvite(id string) (string, error)

	SaveReportRequest(start time.Time, end time.Time, qID string, tags []string, other map[string]interface{}, u auth.User) error
	HasGeneratedReport(orgID string) (bool, error)

	SaveSummonAcceptance(beneficiaryID string, summonID string, meetingID string, jti string, org string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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