uggscrapper

package
v0.0.0-...-1a16a5c Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Iron        = "iron"
	Bronze      = "bronze"
	Silver      = "silver"
	Gold        = "gold"
	Platinum    = "platinum"
	Diamond     = "diamond"
	Master      = "master"
	Grandmaster = "grandmaster"
	Challenger  = "challenger"
	PlatPlus    = "platinum_plus"
	DiamPlus    = "diamond_plus"
	MasterPlus  = "master_plus"
	All         = "overall"
)

U.GG rank query strings

View Source
const (
	Default = ""
	Top     = "top"
	Jungle  = "jungle"
	Mid     = "middle"
	Bot     = "bot"
	Supp    = "support"
)

U.GG position query strings

Variables

Ranks from U.GG ordered from lower to higher

Functions

func GetWR

func GetWR(cfg Config, rank string) float64

GetWR makes a request to u.gg and returns the winrate of the config and rank passed

func GetWRsByRank

func GetWRsByRank(cfg Config) map[string]float64

GetWRsByRank returns a map of Rank - Winrate, with the Ranks constant keys

Types

type Config

type Config struct {
	Champ string
	Role  string
	Patch string
}

Config stores info about what we are interested in when calling a function (champ, role, patch...)

func (Config) QueryParamChamp

func (c Config) QueryParamChamp() string

QueryParamChamp returns the config's Champ property with the valid's u.gg format (lowercase and no spaces)

This allows the users to pass "Aurelion Sol" in the config instead of "aurelionsol"

func (Config) QueryParamPatch

func (c Config) QueryParamPatch() string

QueryParamPatch returns the config's Patch property with the valid's u.gg format (with underscores)

This allows the users to pass "10.12" in the config instead of "10_12"

func (Config) QueryParamRole

func (c Config) QueryParamRole() string

QueryParamRole returns the config's Role property with the valid's u.gg format (lowercase and no spaces)

This allows the users to pass "Top" in the config instead of "top"

Jump to

Keyboard shortcuts

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