mock

package
v0.0.0-...-cb2c959 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchEvent = fmt.Errorf("mock: no such event")

ErrNoSuchEvent is returned when an event does not exist in the mock db.

View Source
var ErrNoSuchTeam = fmt.Errorf("mock: no such team")

ErrNoSuchTeam is returned when a team does not exist in the mock db.

View Source
var ErrNoSuchYear = fmt.Errorf("mock: no such year")

ErrNoSuchYear is returned when a year does not exist in the mock db.

Functions

This section is empty.

Types

type DB

type DB struct {
	Events  map[int][]event.BasicEvent // year --> events
	Matches map[string][]match.Match   // eventkey --> matches
	Photos  map[int]map[string]string  // year --> eventkey --> photo
}

DB mocks a TBA API Consumer.

func (DB) GetEvents

func (db DB) GetEvents(year int) ([]event.BasicEvent, error)

GetEvents gets all events in the mock db for TBA by year.

func (DB) GetMatches

func (db DB) GetMatches(eventKey string) ([]match.Match, error)

GetMatches gets all matches in the mock db for TBA by eventKey.

func (DB) GetPhotoURL

func (db DB) GetPhotoURL(team string, year int) (string, error)

GetPhotoURL gets the photo URL in the mock db for TBA by year and team.

Jump to

Keyboard shortcuts

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