Documentation ¶
Index ¶
Constants ¶
View Source
const ( DBTypeMySQL = "mysql" DBTypePostgres = "postgres" )
View Source
const ( SurveyStatusInProgress = "in_progress" SurveyStatusEnded = "ended" QuestionTypeLinearScale = "linear_scale" QuestionType = "text" TeamFilterSendToAll = "everyone" TeamFilterIncludeSelected = "include_selected" TeamFilterExcludeSelected = "exclude_selected" )
View Source
const ( ResponseTypeComplete = "complete" ResponseTypePartial = "partial" )
Variables ¶
View Source
var (
SurveyStatuses = []string{SurveyStatusInProgress, SurveyStatusEnded}
)
Functions ¶
func IsErrNotFound ¶
Types ¶
type Config ¶
type Config struct { EnableSurvey bool `json:"EnableSurvey"` SurveyDateTime SurveyDateTime `json:"SurveyDateTime"` SurveyExpiry SurveyExpiry `json:"SurveyExpiry"` SurveyQuestions SurveyQuestions `json:"SurveyQuestions"` TeamFilter TeamFilter `json:"TeamFilter"` }
func (*Config) ParsedTime ¶
func (*Config) ShouldSurveyStart ¶
type ErrorResponse ¶
type Survey ¶
type Survey struct { ID string `json:"id"` FilterTeamIDs []string `json:"excludedTeamIDs"` TeamFilterType string `json:"teamFilterType"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` StartTime int64 `json:"startTime"` Duration int `json:"duration"` SurveyQuestions SurveyQuestions `json:"surveyQuestions"` Status string `json:"status"` }
func (*Survey) GetEndTime ¶
func (*Survey) GetSystemRatingQuestionID ¶
func (*Survey) SetDefaults ¶
func (s *Survey) SetDefaults()
func (*Survey) ShouldSurveyStop ¶
type SurveyDateTime ¶
type SurveyDateTime struct {
Timestamp int64 `json:"timestamp"`
}
type SurveyExpiry ¶
type SurveyExpiry struct {
Days int `json:"days"`
}
type SurveyQuestions ¶
type SurveyQuestions struct { Questions []Question `json:"questions"` SurveyMessageText string `json:"surveyMessageText"` }
func (*SurveyQuestions) GetMetadata ¶
func (sq *SurveyQuestions) GetMetadata() []interface{}
type SurveyResponse ¶
type SurveyResponse struct { ID string `json:"ID"` UserID string `json:"userID"` SurveyID string `json:"surveyID"` Response map[string]string `json:"response"` // map of question ID to response CreateAt int64 `json:"createAt"` ResponseType string `json:"responseType"` }
func (*SurveyResponse) IsValid ¶
func (sr *SurveyResponse) IsValid() error
func (*SurveyResponse) SetDefaults ¶
func (sr *SurveyResponse) SetDefaults()
func (*SurveyResponse) ToReportRow ¶
func (sr *SurveyResponse) ToReportRow(surveyQuestions []Question) []string
type SurveyStat ¶
type SurveyStat struct { Survey ReceiptCount int64 `json:"receiptCount"` ResponseCount int64 `json:"responseCount"` PassiveCount int64 `json:"passiveCount"` PromoterCount int64 `json:"promoterCount"` DetractorCount int64 `json:"detractorCount"` }
func (*SurveyStat) ToMetadata ¶
func (stat *SurveyStat) ToMetadata() map[string]interface{}
type TeamFilter ¶
Click to show internal directories.
Click to hide internal directories.