repo

package
v0.0.0-...-15f6f3f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChallengeImagesRepo

type ChallengeImagesRepo interface {
	GetChallengeImages(
		number int, label string) (images [][]byte, answer string, err error)
	ScanForChallenges() error
}

func NewChallengeImagesRepo

func NewChallengeImagesRepo(db *gorm.DB, imageFolder string) (ChallengeImagesRepo, error)

type ChallengeQuestionsRepo

type ChallengeQuestionsRepo interface {
	GetChallengeQuestions(number int, label string) ([]*QuestionChallenge, error)
	CreateChallenge(label string, question string, answer string) (*QuestionChallenge, error)
	DeleteChallenge(id uint) error
}

func NewChallengeQuestionsRepo

func NewChallengeQuestionsRepo(db *gorm.DB) (ChallengeQuestionsRepo, error)

type ImageChallenge

type ImageChallenge struct {
	gorm.Model
	Label string
	Path  string
}

type QuestionChallenge

type QuestionChallenge struct {
	gorm.Model
	Label    string
	Question string
	Answer   string
}

type Session

type Session struct {
	gorm.Model
	UUID        string
	SessionType SessionType
	Answer      string
}

type SessionRepo

type SessionRepo interface {
	CreateSession(uuid string, sessionType SessionType, answer string) error
	GetSession(uuid string) (*Session, error)
	DeleteSession(uuid string) error
}

func NewSessionRepo

func NewSessionRepo(db *gorm.DB) (SessionRepo, error)

type SessionType

type SessionType int
var (
	SessionType_Images       SessionType = 0
	SessionType_Alphanumeric SessionType = 1
	SessionType_Questions    SessionType = 2
)

Jump to

Keyboard shortcuts

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