Documentation ¶
Index ¶
- func Call(f string, i ...interface{}) events.APIGatewayProxyResponse
- func Delete(m Manageable)
- func Find(m Manageable)
- func FindUsers(token string) *[]User
- func Save(s Storable)
- func SaveUser(s *User)
- type Challenge
- type ChallengeResponse
- type Manageable
- type Session
- func (s *Session) DeleteSession()
- func (s *Session) IsEmpty() bool
- func (s *Session) IsExpired() bool
- func (s *Session) IsNotEmpty() bool
- func (s *Session) IsNotExpired() bool
- func (s *Session) Key() map[string]*dynamodb.AttributeValue
- func (s *Session) NewSession()
- func (s *Session) SaveSession()
- func (s *Session) Table() *string
- type Storable
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
func Call(f string, i ...interface{}) events.APIGatewayProxyResponse
func Delete ¶
func Delete(m Manageable)
func Find ¶
func Find(m Manageable)
Types ¶
type Challenge ¶
type Challenge struct { // Token is a unique 64 character alphanumeric string and identifier of a single Quivlet session. Token string `json:"token"` Index int `json:"index"` Category string `json:"category"` Type string `json:"type"` Difficulty string `json:"difficulty"` Question string `json:"question"` CorrectAnswer string `json:"correct_answer"` IncorrectAnswers []string `json:"incorrect_answers"` }
func NewChallenge ¶
func (*Challenge) FindChallenge ¶
func (c *Challenge) FindChallenge()
func (*Challenge) SaveChallenge ¶
func (c *Challenge) SaveChallenge()
type ChallengeResponse ¶
type ChallengeResponse struct {
Challenges []Challenge `json:"results"`
}
type Manageable ¶
type Manageable interface { Storable Key() map[string]*dynamodb.AttributeValue }
type Session ¶
type Session struct { ID string `json:"id"` // Token is a unique 64 character alphanumeric string and identifier of a single Quivlet session. Token string `json:"token"` // Expiry is the Unix (millisecond) value, which defines the deadline for joining this session. Expiry int64 `json:"expiry"` }
Session is an opentdb construct. They are described as unique keys that will help keep track of the questions we have received from said API. The Session Token guarantees that we will not receive the same question twice, until we have exhausted all ≈14,000 questions. Aside: Jeopardy episodes have 94 questions, incl. Daily Doubles and Final Jeopardy.
func FindSession ¶
func FindSession() *Session
func (*Session) DeleteSession ¶
func (s *Session) DeleteSession()
func (*Session) IsNotEmpty ¶
func (*Session) IsNotExpired ¶
func (*Session) NewSession ¶
func (s *Session) NewSession()
NewSession sets the expiry of our future token first to hedge our time bets, retrieves a new token from an API call to the opentdb session token request endpoint, then sets said token on the session.
func (*Session) SaveSession ¶
func (s *Session) SaveSession()
type User ¶
type User struct { // Token is a unique 64 character alphanumeric string and identifier of a single Quivlet session. Token string `json:"token"` // ID is the string representation of a 128 bit (16 byte) Universal Unique Identifier as defined in RFC 4122. ID string `json:"id"` // Name is a self defined or randomly generated username for friendly statistic reporting. Name string `json:"name"` // Result is a slice of int64's where each value represents a correctly answered challenge in a certain time period. Result []int64 `json:"result"` // Eliminated is used to flag a user that answered a challenge incorrectly and no longer part of the contest. Eliminated bool `json:"eliminated"` Save bool }
User is the identity associated with a Quivlet contestant.
Click to show internal directories.
Click to hide internal directories.