trivia

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMoreQuestions = errors.New("no more questions")

Functions

This section is empty.

Types

type Game

type Game struct {
	Questions []*question.Question `json:"questions"`
	// contains filtered or unexported fields
}

func DefaultGame

func DefaultGame() (*Game, error)

func NewGame

func NewGame(options ...Option) (*Game, error)

func (*Game) GetCurrentQuestion

func (g *Game) GetCurrentQuestion() (*question.Question, error)

func (*Game) Next

func (g *Game) Next() bool

Next returns the next question in the list if it exists and a true. Otherwise returns and empty question and false

func (*Game) Reset

func (g *Game) Reset()

type Option

type Option func(g *Game) error

func WithQuestions

func WithQuestions(questions []byte) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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