Documentation ¶
Index ¶
- Constants
- type Badge
- type Challenge
- func (ch *Challenge) AllowDetailsEdit() bool
- func (ch *Challenge) AllowOutcomeEdit() bool
- func (ch *Challenge) AllowShowVotes() bool
- func (ch *Challenge) AllowVoting() bool
- func (ch *Challenge) EditURL() string
- func (ch *Challenge) EndStr() string
- func (ch *Challenge) Finished() bool
- func (ch *Challenge) HasOutcome() bool
- func (ch *Challenge) HasOutcomeAndTrue() bool
- func (ch *Challenge) HasProofs() bool
- func (ch *Challenge) PercFalse() int
- func (ch *Challenge) PercTrue() int
- func (ch *Challenge) StartStr() string
- func (ch *Challenge) Started() bool
- func (ch *Challenge) URL() string
- func (ch *Challenge) Votes() int
- func (ch *Challenge) VotesFalse() int
- func (ch *Challenge) VotesTrue() int
- type CreateChallengeArgs
- type CreatePredictionFromPresetArgs
- type FilterChallengesArgs
- type Prediction
- type Proof
- type SystemSymmary
- type User
- type UserSession
- type UserSummary
Constants ¶
View Source
const ( ChallengeTypeBool = "bool" ChallengeTimeFormat = "2006-01-02" LocaleRu = "ru" LocaleEn = "en" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct { ID uuid.UUID AuthorID uuid.UUID Type string Content string Description string Outcome *bool Published bool StartTime time.Time EndTime time.Time Predictions []*Prediction Proofs []*Proof UserPrediction *Prediction }
func (*Challenge) AllowDetailsEdit ¶
func (*Challenge) AllowOutcomeEdit ¶
func (*Challenge) AllowShowVotes ¶ added in v0.0.3
func (*Challenge) AllowVoting ¶
func (*Challenge) HasOutcome ¶
func (*Challenge) HasOutcomeAndTrue ¶
func (*Challenge) VotesFalse ¶
type CreateChallengeArgs ¶
type CreateChallengeArgs struct { Type string `json:"type"` Content string `json:"content"` Description string `json:"description"` StartTime string `json:"startTime"` EndTime string `json:"endTime"` Published bool `json:"published"` TimeLayout string `json:"timeLayout"` Outcome *bool `json:"outcome"` AuthorID uuid.UUID `json:"authorID"` }
func (*CreateChallengeArgs) GetEndTime ¶
func (a *CreateChallengeArgs) GetEndTime() (time.Time, error)
func (*CreateChallengeArgs) GetStartEndTime ¶
func (*CreateChallengeArgs) GetStartTime ¶
func (a *CreateChallengeArgs) GetStartTime() (time.Time, error)
func (*CreateChallengeArgs) Validate ¶
func (a *CreateChallengeArgs) Validate() error
type FilterChallengesArgs ¶
type FilterChallengesArgs struct { UserID uuid.UUID AuthorID uuid.UUID Unvoted bool Ongoing bool Pending bool Unpublished bool Finished bool Limit int Offset int }
func (*FilterChallengesArgs) Validate ¶
func (a *FilterChallengesArgs) Validate(requireUser bool) error
type Prediction ¶
type SystemSymmary ¶
type UserSession ¶
type UserSummary ¶
type UserSummary struct { UserID uuid.UUID CorrectPredictions int IncorrectPredictions int UnknownPredictions int }
func (*UserSummary) PercCorrect ¶
func (us *UserSummary) PercCorrect() int
func (*UserSummary) PercIncorrect ¶
func (us *UserSummary) PercIncorrect() int
Click to show internal directories.
Click to hide internal directories.