handlers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthProbe

func HealthProbe(w http.ResponseWriter, req *http.Request)

func ParseHeaderID

func ParseHeaderID(requestId string) (string, string, bool)

Types

type HomerosHandler

type HomerosHandler struct {
	HttpClients service.OdysseiaClient
	Cache       archytas.Client
	Tracer      *aristophanes.ClientTracer
	Randomizer  randomizer.Random
}

func CreateNewConfig

func CreateNewConfig(env string) (*HomerosHandler, error)

func (*HomerosHandler) Answer

func (h *HomerosHandler) Answer(id, author, answer, requestID string) (*models.Answer, error)

func (*HomerosHandler) Books

func (h *HomerosHandler) Books(requestID string) ([]models.AuthorTree, error)

func (*HomerosHandler) CheckQuestion

func (h *HomerosHandler) CheckQuestion(quiz, providedAnswer, requestID string) (*plato.CheckAnswerResponse, error)

func (*HomerosHandler) CloseTrace

func (h *HomerosHandler) CloseTrace(response *http.Response, body interface{})

func (*HomerosHandler) CloseTraceWithError

func (h *HomerosHandler) CloseTraceWithError(err error, requestId string)

todo refactor to actual have a meaningful code this has to be changed in the plato client

func (*HomerosHandler) CreateQuestion

func (h *HomerosHandler) CreateQuestion(method, category, chapter, requestID string) (*plato.QuizResponse, error)

func (*HomerosHandler) Dictionary

func (h *HomerosHandler) Dictionary(word, language, mode, traceID string) ([]plato.Meros, error)

func (*HomerosHandler) Grammar

func (h *HomerosHandler) Grammar(word, traceID string) ([]plato.Result, error)

func (*HomerosHandler) Health

func (h *HomerosHandler) Health(requestId string) (*models.Health, error)

func (*HomerosHandler) Methods

func (h *HomerosHandler) Methods(requestID string) ([]models.MethodTree, error)

func (*HomerosHandler) Sentence

func (h *HomerosHandler) Sentence(author, book, requestID string) (*models.SentenceGraph, error)

type OperationScore

type OperationScore struct {
	Operation string `json:"operation"`
	Score     int    `json:"score"`
}

type TraceConfig

type TraceConfig struct {
	OperationScores []OperationScore `json:"operationScores"`
}

func InitTracingConfig

func InitTracingConfig() *TraceConfig

Jump to

Keyboard shortcuts

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