wktesting

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LiveClient

func LiveClient() *wanikaniapi.Client

LiveClient checks to see if WANI_KANI_API_TOKEN is set in the environment. If it is, it returns a WaniClient API client suitable for making live API calls. If it isn't, it returns nil. It's up to the calling test to return in the latter case to avoid failure.

func LocalClient

func LocalClient() *wanikaniapi.Client

LocalClient returns a WaniKani API client with RecordMode on. This means that instead of making live API calls, it saves them to RecoredRequests. This is suitable for most tests and allows us to avoid mutating our associated WaniKani account or exhausting its rate limit.

func MustMarshalJSON

func MustMarshalJSON(v interface{}) []byte

MustMarshalJSON is the same as url.QueryUnescape except it panics on error.

func MustQueryUnescape

func MustQueryUnescape(s string) string

MustQueryUnescape is the same as url.QueryUnescape except it panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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