Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Answer string `json:"svar"` Category string `json:"kategorinavn"` Created string `json:"@opprettet"` AnswerID string `json:"svarId"` Question string `json:"spørsmål,omitempty"` QuestionID string `json:"spørsmålId"` AnswerFormat string `json:"svarformat,omitempty"` TeamName string `json:"lagnavn"` Type MessageType `json:"@event_name"` }
Message is a struct that represents a message in the Leesah Kafka topic
func (Message) ToQuestion ¶
ToQuestion converts a Message to a simpler Question
type MessageType ¶
type MessageType string
const ( MessageTypeQuestion MessageType = "SPØRSMÅL" MessageTypeAnswer MessageType = "SVAR" // LeesahTimeformat is Python's time format for Leesah messages, which is a form of RFC3339 LeesahTimeformat = "2006-01-02T15:04:05.999999" )
type MinimalMessage ¶
type MinimalMessage struct {
Type MessageType `json:"@event_name"`
}
MinimalMessage is a simplified version of a Message with just the type
type Rapid ¶
type Rapid struct {
// contains filtered or unexported fields
}
func NewLocalRapid ¶
NewLocalRapid creates a new Rapid instance with a local configuration. The local configuration is read from "certs/student-creds.yaml". It is used when playing the local edition of Leesah. You can override the path to the local certification by setting the environment variable QUIZ_CERT. You can also override the topic by setting the environment variable QUIZ_TOPIC.
func NewRapid ¶
func NewRapid(teamName string, config RapidConfig) (*Rapid, error)
NewRapid creates a new Rapid instance with the given configuration. It is used when playing the Nais-edition of Leesah.