db

package
v0.0.0-...-95c9f63 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuestionSetRepo

type QuestionSetRepo struct {
	*mongo.Collection
}

QuestionSetRepo - MongoDB Collection

func NewQuestionSetRepo

func NewQuestionSetRepo(ctx context.Context, config string, db string) (*QuestionSetRepo, error)

NewQuestionSetRepo - Connect to Database and return connection

func (*QuestionSetRepo) DeleteQuestionSet

func (qr *QuestionSetRepo) DeleteQuestionSet(ctx context.Context, id string) error

DeleteQuestionSet - Delete a Set of Questions

func (*QuestionSetRepo) GetQuestionSet

func (qsr *QuestionSetRepo) GetQuestionSet(ctx context.Context, id string) (*models.QuestionSet, error)

GetQuestionSet - Return a reponse based ID given

func (*QuestionSetRepo) ListQuestionSet

func (qsr *QuestionSetRepo) ListQuestionSet(ctx context.Context) ([]*models.QuestionSet, error)

ListQuestionSet - Return a List of Questions

func (*QuestionSetRepo) SaveQuestionSet

func (qsr *QuestionSetRepo) SaveQuestionSet(ctx context.Context, r *models.QuestionSet) error

SaveQuestionSet - Save Set of Questions to Database

type QuestionsRepo

type QuestionsRepo struct {
	*mongo.Collection
}

QuestionsRepo - MonogoDB Connection

func NewQuestionsRepo

func NewQuestionsRepo(ctx context.Context, config string, db string) (*QuestionsRepo, error)

NewQuestionsRepo - Connect to Database and return connection

func (*QuestionsRepo) DeleteResponse

func (qr *QuestionsRepo) DeleteResponse(ctx context.Context, id string) error

DeleteResponse - Delete a Response

func (*QuestionsRepo) GetByID

func (qr *QuestionsRepo) GetByID(ctx context.Context, id string) (*models.Response, error)

GetByID - Return a reponse based ID given

func (*QuestionsRepo) ListResponses

func (qr *QuestionsRepo) ListResponses(ctx context.Context) ([]*models.Response, error)

ListResponses - Return a List of Responses

func (*QuestionsRepo) SaveResponse

func (qr *QuestionsRepo) SaveResponse(ctx context.Context, r *models.Response) error

SaveResponse - Save Reponse to database

Jump to

Keyboard shortcuts

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