Documentation
¶
Index ¶
- Constants
- func GrammarInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- type GrammarBasedQuiz
- type GrammarClient
- func (g *GrammarClient) Answer(ctx context.Context, request *pb.AnswerRequest) (*pb.ComprehensiveResponse, error)
- func (g *GrammarClient) Health(ctx context.Context, request *pb.HealthRequest) (*pb.HealthResponse, error)
- func (g *GrammarClient) Options(ctx context.Context, request *pb.OptionsRequest) (*pb.AggregatedOptions, error)
- func (g *GrammarClient) Question(ctx context.Context, request *pb.CreationRequest) (*pb.QuizResponse, error)
- func (g *GrammarClient) WaitForHealthyState() bool
- type GrammarContent
- type GrammarService
- type GrammarServiceClient
- type GrammarServiceImpl
- func (g *GrammarServiceImpl) Answer(ctx context.Context, request *pb.AnswerRequest) (*pb.ComprehensiveResponse, error)
- func (g *GrammarServiceImpl) Health(context.Context, *pb.HealthRequest) (*pb.HealthResponse, error)
- func (g *GrammarServiceImpl) Options(ctx context.Context, request *pb.OptionsRequest) (*pb.AggregatedOptions, error)
- func (g *GrammarServiceImpl) Question(ctx context.Context, request *pb.CreationRequest) (*pb.QuizResponse, error)
- type ProgressTracker
- func (p *ProgressTracker) ClearSegment(sessionId, segmentKey string)
- func (p *ProgressTracker) Exists(sessionId, segmentKey string) bool
- func (p *ProgressTracker) GetPlayableWords(sessionId, segmentKey string, doneAfter int) (unplayed, unmastered []string)
- func (p *ProgressTracker) GetProgressForSegment(sessionId, segmentKey string, doneAfter int) (map[string]*WordProgress, bool)
- func (p *ProgressTracker) GetRetryableWords(sessionId, segmentKey string, doneAfter int) []string
- func (p *ProgressTracker) InitWordsForSegment(sessionId, segmentKey string, greekWords []string)
- func (p *ProgressTracker) RecordAnswerResult(sessionId, segmentKey, greekWord string, correct bool)
- func (p *ProgressTracker) RecordWordPlay(sessionId, segmentKey, greekWord, translation string)
- func (p *ProgressTracker) ResetSegment(sessionId, segmentKey string)
- type SessionProgress
- type WordProgress
Constants ¶
View Source
const ( OPTIONSEGMENTKEY string = "archytassavedoptions" THEME string = "theme" SET string = "set" SEGMENT string = "segment" )
View Source
const (
DEFAULTADDRESS string = "localhost:50060"
)
Variables ¶
This section is empty.
Functions ¶
func GrammarInterceptor ¶
func GrammarInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Types ¶
type GrammarBasedQuiz ¶
type GrammarClient ¶
type GrammarClient struct {
// contains filtered or unexported fields
}
func NewAnisthenesClient ¶
func NewAnisthenesClient(address string) (*GrammarClient, error)
func (*GrammarClient) Answer ¶
func (g *GrammarClient) Answer(ctx context.Context, request *pb.AnswerRequest) (*pb.ComprehensiveResponse, error)
func (*GrammarClient) Health ¶
func (g *GrammarClient) Health(ctx context.Context, request *pb.HealthRequest) (*pb.HealthResponse, error)
func (*GrammarClient) Options ¶
func (g *GrammarClient) Options(ctx context.Context, request *pb.OptionsRequest) (*pb.AggregatedOptions, error)
func (*GrammarClient) Question ¶
func (g *GrammarClient) Question(ctx context.Context, request *pb.CreationRequest) (*pb.QuizResponse, error)
func (*GrammarClient) WaitForHealthyState ¶
func (g *GrammarClient) WaitForHealthyState() bool
type GrammarContent ¶
type GrammarContent struct {
Greek string `json:"greek"`
DictionaryForm string `json:"dictionaryForm"`
Translation string `json:"translation"`
Stem string `json:"stem"`
GrammarQuestion struct {
Tense string `json:"tense"`
Voice string `json:"voice"`
Mood string `json:"mood"`
Person string `json:"person"`
Number string `json:"number"`
CorrectAnswer string `json:"correctAnswer"`
} `json:"grammarQuestion"`
}
type GrammarService ¶
type GrammarService interface {
WaitForHealthyState() bool
Options(ctx context.Context, request *pb.OptionsRequest) (*pb.AggregatedOptions, error)
Question(ctx context.Context, request *pb.CreationRequest) (*pb.QuizResponse, error)
Answer(ctx context.Context, request *pb.AnswerRequest) (*pb.ComprehensiveResponse, error)
}
type GrammarServiceClient ¶
type GrammarServiceClient struct {
Impl GrammarService
}
type GrammarServiceImpl ¶
type GrammarServiceImpl struct {
Elastic aristoteles.Client
Index string
Version string
Randomizer randomizer.Random
Client service.OdysseiaClient
Streamer pbar.TraceService_ChorusClient
Archytas archytas.Client
Progress *ProgressTracker
pb.UnimplementedAnisthenesServer
}
func CreateNewConfig ¶
func CreateNewConfig(ctx context.Context) (*GrammarServiceImpl, error)
func (*GrammarServiceImpl) Answer ¶
func (g *GrammarServiceImpl) Answer(ctx context.Context, request *pb.AnswerRequest) (*pb.ComprehensiveResponse, error)
func (*GrammarServiceImpl) Health ¶
func (g *GrammarServiceImpl) Health(context.Context, *pb.HealthRequest) (*pb.HealthResponse, error)
func (*GrammarServiceImpl) Options ¶
func (g *GrammarServiceImpl) Options(ctx context.Context, request *pb.OptionsRequest) (*pb.AggregatedOptions, error)
func (*GrammarServiceImpl) Question ¶
func (g *GrammarServiceImpl) Question(ctx context.Context, request *pb.CreationRequest) (*pb.QuizResponse, error)
type ProgressTracker ¶
type ProgressTracker struct {
sync.RWMutex
Data map[string]*SessionProgress
}
func (*ProgressTracker) ClearSegment ¶
func (p *ProgressTracker) ClearSegment(sessionId, segmentKey string)
func (*ProgressTracker) Exists ¶
func (p *ProgressTracker) Exists(sessionId, segmentKey string) bool
func (*ProgressTracker) GetPlayableWords ¶
func (p *ProgressTracker) GetPlayableWords(sessionId, segmentKey string, doneAfter int) (unplayed, unmastered []string)
func (*ProgressTracker) GetProgressForSegment ¶
func (p *ProgressTracker) GetProgressForSegment(sessionId, segmentKey string, doneAfter int) (map[string]*WordProgress, bool)
func (*ProgressTracker) GetRetryableWords ¶
func (p *ProgressTracker) GetRetryableWords(sessionId, segmentKey string, doneAfter int) []string
func (*ProgressTracker) InitWordsForSegment ¶
func (p *ProgressTracker) InitWordsForSegment(sessionId, segmentKey string, greekWords []string)
func (*ProgressTracker) RecordAnswerResult ¶
func (p *ProgressTracker) RecordAnswerResult(sessionId, segmentKey, greekWord string, correct bool)
func (*ProgressTracker) RecordWordPlay ¶
func (p *ProgressTracker) RecordWordPlay(sessionId, segmentKey, greekWord, translation string)
func (*ProgressTracker) ResetSegment ¶
func (p *ProgressTracker) ResetSegment(sessionId, segmentKey string)
type SessionProgress ¶
type SessionProgress struct {
// Key: "theme+set+segment"
// Value: map of Greek word -> WordProgress
Progress map[string]map[string]*WordProgress
PreviousRuns map[string][]map[string]*WordProgress
}
Click to show internal directories.
Click to hide internal directories.