models

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Question

type Question struct {
	Question string `json:"question" bson:"question"`
	Answer   string `json:"answer" bson:"answer"`
}

Question - Question And Answers

type QuestionSet

type QuestionSet struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Date        time.Time          `bson:"date" json:"date"`
	QuestionSet []string           `bson:"question_set" json:"question_set"`
}

QuestionSet - Set of Questions to ask

type QuestionSetData

type QuestionSetData interface {
	SaveQuestionSet(ctx context.Context, qs *QuestionSet) error
	DeleteQuestionSet(ctx context.Context, qs string) error
	ListQuestionSet(ctx context.Context) ([]*QuestionSet, error)
	GetQuestionSet(ctx context.Context, qsID string) (*QuestionSet, error)
}

QuestionSetData - Storage Abstraction for what questions to ask

type QuestionsData

type QuestionsData interface {
	SaveResponse(ctx context.Context, reps *Response) error
	DeleteResponse(ctx context.Context, respID string) error
	ListResponses(ctx context.Context) ([]*Response, error)
	GetByID(ctx context.Context, qID string) (*Response, error)
}

QuestionsData - Storage Abstraction for question objects

type Response

type Response struct {
	ID        primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Date      time.Time          `json:"date" bson:"date"`
	Questions []Question         `json:"questions" bson:"questions"`
}

Response - Answers to daily questions

type User

type User struct {
	ID       primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Username string             `json:"username" bson:"username"`
	PhoneNum string             `json:"phone_num" bson:"phone_num"`
}

User - Authenticated User that is making these responses

type UserData

type UserData interface {
	CreateUser(user *User) error
	GetUser(user string) (*User, error)
	DeleteUser(user string) error
	ListUsers() ([]*User, error)
}

UserData - Storage Abstraction for user objects

Jump to

Keyboard shortcuts

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