ui

package
v0.0.0-...-e29a901 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

type Renderer interface {
	PrintHeader(title string)
	PrintTeamPoints(bootstrap responses.BootstrapData, live responses.GameweekLiveScores, points responses.GameweekPoints)
	PrintRivalPoints(bootstrap responses.BootstrapData, live responses.GameweekLiveScores, points responses.GameweekPoints, details responses.ManagerDetails)
	PrintManagerDetails(details responses.ManagerDetails)
	PrintClassicLeagues(details responses.ManagerDetails, teamsParser helpers.TeamsParser)
	PrintGlobalLeagues(detailsResponse responses.ManagerDetails, teamsParser helpers.TeamsParser)
	PrintTransfersAndFinance(detailsResponse responses.ManagerDetails, teamsParser helpers.TeamsParser)
	PrintGameweekFixtures(bootstrap responses.BootstrapData, fixtures responses.GameweekFixtures, teamsParser helpers.TeamsParser, gameweek int)
	PrintSeasonDetails(history responses.ManagerHistory, teamsParser helpers.TeamsParser)
	PrintChipDetails(history responses.ManagerHistory)
	PrintPreviousSeasonDetails(history responses.ManagerHistory)
	PrintNoRivalsWarning()
}

Renderer is an abstraction that allows me to implement multiple renderers whilst also allowing me to unit test

type TerminalRenderer

type TerminalRenderer struct {
}

TerminalRenderer is my concrete implementation of the Renderer interface, outputting to the terminal

func (TerminalRenderer) PrintChipDetails

func (t TerminalRenderer) PrintChipDetails(history responses.ManagerHistory)

PrintChipDetails prints details around what chips have been used

func (TerminalRenderer) PrintClassicLeagues

func (t TerminalRenderer) PrintClassicLeagues(details responses.ManagerDetails, teamsParser helpers.TeamsParser)

PrintClassicLeagues prints all classic leagues and the current rank for each

func (TerminalRenderer) PrintGameweekFixtures

func (t TerminalRenderer) PrintGameweekFixtures(bootstrap responses.BootstrapData, fixtures responses.GameweekFixtures, teamsParser helpers.TeamsParser, gameweek int)

PrintGameweekFixtures prints the fixtures for the specified gameweek

func (TerminalRenderer) PrintGlobalLeagues

func (t TerminalRenderer) PrintGlobalLeagues(detailsResponse responses.ManagerDetails, teamsParser helpers.TeamsParser)

PrintGlobalLeagues prints all global leagues and the current rank for each

func (TerminalRenderer) PrintHeader

func (t TerminalRenderer) PrintHeader(title string)

PrintHeader will print standardised header, calculating the appropriate length from the titles characters

func (TerminalRenderer) PrintManagerDetails

func (t TerminalRenderer) PrintManagerDetails(details responses.ManagerDetails)

PrintManagerDetails prints the summary details for a manager

func (TerminalRenderer) PrintNoRivalsWarning

func (t TerminalRenderer) PrintNoRivalsWarning()

PrintNoRivalsWarning prints a warning when no rivals have been specified in the config

func (TerminalRenderer) PrintPreviousSeasonDetails

func (t TerminalRenderer) PrintPreviousSeasonDetails(history responses.ManagerHistory)

PrintPreviousSeasonDetails prints a teams record from past seasons

func (TerminalRenderer) PrintRivalPoints

PrintRivalPoints prints out the details for the rivals given the teamID in details

func (TerminalRenderer) PrintSeasonDetails

func (t TerminalRenderer) PrintSeasonDetails(history responses.ManagerHistory, teamsParser helpers.TeamsParser)

PrintSeasonDetails prints a teams current season details for each gameweek

func (TerminalRenderer) PrintTeamPoints

PrintTeamPoints prints the points the team has

func (TerminalRenderer) PrintTransfersAndFinance

func (t TerminalRenderer) PrintTransfersAndFinance(detailsResponse responses.ManagerDetails, teamsParser helpers.TeamsParser)

PrintTransfersAndFinance prints details for a teamsd transfers, value and money in the bank

Jump to

Keyboard shortcuts

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