This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "github.com/99designs/gqlgen/graphql/handler" | |
| "github.com/99designs/gqlgen/graphql/playground" | |
| "github.com/joho/godotenv" | |
| _ "github.com/lib/pq" | |
| "log" | |
| "multi-choice/app/domain/repository/answer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package db | |
| import ( | |
| "github.com/jinzhu/gorm" | |
| "log" | |
| "multi-choice/app/models" | |
| "os" | |
| ) | |
| func OpenDB(database string) *gorm.DB { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package persistence | |
| import ( | |
| "errors" | |
| "github.com/jinzhu/gorm" | |
| "multi-choice/app/domain/repository/question_option" | |
| "multi-choice/app/models" | |
| ) | |
| type optService struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package persistence | |
| import ( | |
| "errors" | |
| "github.com/jinzhu/gorm" | |
| "multi-choice/app/domain/repository/answer" | |
| "multi-choice/app/models" | |
| ) | |
| type ansService struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package persistence | |
| import ( | |
| "errors" | |
| "github.com/jinzhu/gorm" | |
| "multi-choice/app/domain/repository/question" | |
| "multi-choice/app/models" | |
| "strings" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package question_option | |
| import ( | |
| "multi-choice/app/models" | |
| ) | |
| type OptService interface { | |
| CreateQuestionOption(question *models.QuestionOption) (*models.QuestionOption, error) | |
| UpdateQuestionOption(question *models.QuestionOption) (*models.QuestionOption, error) | |
| DeleteQuestionOption(id string) error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package answer | |
| import ( | |
| "multi-choice/app/models" | |
| ) | |
| type AnsService interface { | |
| CreateAnswer(answer *models.Answer) (*models.Answer, error) | |
| UpdateAnswer(answer *models.Answer) (*models.Answer, error) | |
| DeleteAnswer(id string) error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package question | |
| import ( | |
| "multi-choice/app/models" | |
| ) | |
| type QuesService interface { | |
| CreateQuestion(question *models.Question) (*models.Question, error) | |
| UpdateQuestion(question *models.Question) (*models.Question, error) | |
| DeleteQuestion(id string) error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package interfaces | |
| import ( | |
| "multi-choice/app/domain/repository/answer" | |
| "multi-choice/app/domain/repository/question" | |
| "multi-choice/app/domain/repository/question_option" | |
| ) | |
| // This file will not be regenerated automatically. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package interfaces | |
| // This file will be automatically regenerated based on the schema, any resolver implementations | |
| // will be copied through when generating and any unknown code will be moved to the end. | |
| import ( | |
| "context" | |
| "log" | |
| "multi-choice/app/models" | |
| "multi-choice/helpers" |