mock

package
v0.0.0-...-c3c9c93 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mock is the model handler for testing purposes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMock

func RegisterMock(t string)

RegisterMock registers the mock Model as the requested type, for tests.

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is an Anki Basic model

func (*Mock) Action

func (m *Mock) Action(card *fb.Card, face *int, _ time.Time, query interface{}) (bool, error)

Action responds to a card action, such as a button press

func (*Mock) Buttons

func (m *Mock) Buttons(_ int) (studyview.ButtonMap, error)

Buttons returns the initial buttons state

func (*Mock) IframeScript

func (m *Mock) IframeScript() []byte

IframeScript returns JavaScript to run inside the iframe.

func (*Mock) Type

func (m *Mock) Type() string

Type returns the string "anki-basic", to identify this model handler's type.

Jump to

Keyboard shortcuts

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