Documentation ¶
Index ¶
- type Interface
- type Postgres
- func (p *Postgres) Close() error
- func (p *Postgres) CreateSurvey(survey *types.Survey) error
- func (p *Postgres) CreateSurveySession(session *types.SurveySession) error
- func (p *Postgres) GetSurveyByField(field string, value interface{}) (*types.Survey, error)
- func (p *Postgres) GetSurveyQuestions(surveyID int64) ([]types.Question, error)
- func (p *Postgres) GetSurveySession(surveyUUID string, sessionUUID string) (*types.SurveySession, error)
- func (p *Postgres) GetSurveySessionAnswers(sessionUUID string) ([]types.QuestionAnswer, error)
- func (p *Postgres) GetSurveySessionByIPAddress(surveyUUID string, ipAddr string) (*types.SurveySession, error)
- func (p *Postgres) GetSurveySessionsWithAnswers(surveyUUID string, filter *types.SurveySessionsFilter) ([]types.SurveySession, int, error)
- func (p *Postgres) GetSurveys() ([]*types.Survey, error)
- func (p *Postgres) Init() error
- func (p *Postgres) Migrate() error
- func (p *Postgres) Ping() error
- func (p *Postgres) UpdateSurvey(survey *types.Survey) error
- func (p *Postgres) UpdateSurveySessionStatus(sessionUUID string, newStatus types.SurveySessionStatus) error
- func (p *Postgres) UpsertSurveyQuestionAnswer(sessionUUID string, questionUUID string, answer types.Answer) error
- func (p *Postgres) UpsertSurveyQuestions(survey *types.Survey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { Init() error Ping() error Close() error Migrate() error CreateSurvey(survey *types.Survey) error UpdateSurvey(survey *types.Survey) error GetSurveys() ([]*types.Survey, error) GetSurveyByField(field string, value interface{}) (*types.Survey, error) CreateSurveySession(session *types.SurveySession) error UpdateSurveySessionStatus(sessionUUID string, newStatus types.SurveySessionStatus) error GetSurveySessionByIPAddress(surveyUUID string, ipAddr string) (*types.SurveySession, error) GetSurveySession(surveyUUID string, sessionUUID string) (*types.SurveySession, error) UpsertSurveyQuestions(survey *types.Survey) error GetSurveyQuestions(surveyID int64) ([]types.Question, error) GetSurveySessionsWithAnswers(surveyUUID string, filter *types.SurveySessionsFilter) ([]types.SurveySession, int, error) GetSurveySessionAnswers(sessionUUID string) ([]types.QuestionAnswer, error) UpsertSurveyQuestionAnswer(sessionUUID string, questionUUID string, answer types.Answer) error }
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) CreateSurveySession ¶
func (p *Postgres) CreateSurveySession(session *types.SurveySession) error
func (*Postgres) GetSurveyByField ¶
func (*Postgres) GetSurveyQuestions ¶
func (*Postgres) GetSurveySession ¶
func (*Postgres) GetSurveySessionAnswers ¶
func (p *Postgres) GetSurveySessionAnswers(sessionUUID string) ([]types.QuestionAnswer, error)
func (*Postgres) GetSurveySessionByIPAddress ¶
func (*Postgres) GetSurveySessionsWithAnswers ¶
func (p *Postgres) GetSurveySessionsWithAnswers(surveyUUID string, filter *types.SurveySessionsFilter) ([]types.SurveySession, int, error)
func (*Postgres) UpdateSurveySessionStatus ¶
func (p *Postgres) UpdateSurveySessionStatus(sessionUUID string, newStatus types.SurveySessionStatus) error
func (*Postgres) UpsertSurveyQuestionAnswer ¶
Click to show internal directories.
Click to hide internal directories.