Documentation ¶
Index ¶
- type LeagueEntryDTO
- type LeagueInfo
- type MatchReferenceDto
- type MatchlistDto
- type MiniSeriesDTO
- type RedisClient
- func (redisClient *RedisClient) CloseRedisConn()
- func (redisClient *RedisClient) Connect(pwd string)
- func (redisClient *RedisClient) GetConn() *redis.Client
- func (redisClient *RedisClient) SaveSummoner(summoner *Summoner, informationID string) error
- func (redisClient *RedisClient) SearchSummoner(summonerName string, informationID string) (*Summoner, error)
- type RiotAPIClient
- func (riotAPIClient *RiotAPIClient) GetMatchesCurrentDay(accountID string) (*MatchlistDto, error)
- func (riotAPIClient *RiotAPIClient) GetMatchesCurrentMonth(accountID string) (*MatchlistDto, error)
- func (riotAPIClient *RiotAPIClient) GetMatchesCurrentYear(accountID string) (*MatchlistDto, error)
- func (riotAPIClient *RiotAPIClient) GetSummonerByName(summonerName string) (*SummonerDTO, error)
- func (riotAPIClient *RiotAPIClient) GetSummonerLeaguesByID(summonerID string) ([]LeagueEntryDTO, error)
- func (riotAPIClient *RiotAPIClient) GetSummonerMatchesByAccountID(accountID string) (*MatchlistDto, error)
- type Summoner
- type SummonerBuilder
- type SummonerDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeagueEntryDTO ¶
type LeagueEntryDTO struct { LeagueID string `json:"leagueId"` QueueType string `json:"queueType"` Tier string `json:"tier"` Rank string `json:"rank"` SummonerID string `json:"summonerId"` SummonerName string `json:"summonerName"` LeaguePoints int `json:"leaguePoints"` Wins int `json:"wins"` Losses int `json:"losses"` Veteran bool `json:"veteran"` Inactive bool `json:"inactive"` FreshBlood bool `json:"freshBlood"` HotStreak bool `json:"hotStreak"` MiniSeriesDTO MiniSeriesDTO `json:"miniSeries"` }
LeagueEntryDTO - league data response of Riot API
type LeagueInfo ¶
type LeagueInfo struct { LeagueID string `json:"leagueId"` QueueType string `json:"queueType"` Tier string `json:"tier"` Rank string `json:"rank"` LeaguePoints int `json:"leaguePoints"` Wins int `json:"wins"` Losses int `json:"losses"` Veteran bool `json:"veteran"` Inactive bool `json:"inactive"` FreshBlood bool `json:"freshBlood"` HotStreak bool `json:"hotStreak"` MiniSeriesDTO MiniSeriesDTO `json:"miniSeries"` }
LeagueInfo - league data for summoner in custom API
type MatchReferenceDto ¶
type MatchReferenceDto struct { GameID int `json:"gameId"` Role string `json:"role"` Season int `json:"season"` PlatformID string `json:"platformId"` Champion int `json:"champion"` Queue int `json:"queue"` Lane string `json:"lane"` Timestamp int `json:"timestamp"` }
MatchReferenceDto - reference of the match
type MatchlistDto ¶
type MatchlistDto struct { StartIndex int `json:"startIndex"` TotalGames int `json:"totalGames"` EndIndex int `json:"endIndex"` Matches []MatchReferenceDto `json:"matches"` }
MatchlistDto - list of matches from summoner
type MiniSeriesDTO ¶
type MiniSeriesDTO struct { Losses int `json:"losses"` Progress string `json:"progress"` Target int `json:"target"` Wins int `json:"wins"` }
MiniSeriesDTO - mini series of response LeagueEntryDTO of Riot API
type RedisClient ¶
type RedisClient struct { URI string // contains filtered or unexported fields }
RedisClient - Client for Redis
var RedisClientConnected *RedisClient
RedisClientConnected -
func NewRedisClient ¶
func NewRedisClient(host, port string) *RedisClient
NewRedisClient - New client for Redis
func (*RedisClient) CloseRedisConn ¶
func (redisClient *RedisClient) CloseRedisConn()
CloseRedisConn - Close client Redis
func (*RedisClient) Connect ¶
func (redisClient *RedisClient) Connect(pwd string)
Connect - Connect client Redis
func (*RedisClient) GetConn ¶
func (redisClient *RedisClient) GetConn() *redis.Client
GetConn - Get Redis connection with client Redis
func (*RedisClient) SaveSummoner ¶
func (redisClient *RedisClient) SaveSummoner(summoner *Summoner, informationID string) error
SaveSummoner - Save summoner informations in Redis
func (*RedisClient) SearchSummoner ¶
func (redisClient *RedisClient) SearchSummoner(summonerName string, informationID string) (*Summoner, error)
SearchSummoner - Search summoner informations in Redis
type RiotAPIClient ¶
RiotAPIClient - client of Riot API
func NewRiotAPIClient ¶
func NewRiotAPIClient(serverURL, tokenAPI, headerAPI string) *RiotAPIClient
NewRiotAPIClient - create new client Riot API
func (*RiotAPIClient) GetMatchesCurrentDay ¶
func (riotAPIClient *RiotAPIClient) GetMatchesCurrentDay(accountID string) (*MatchlistDto, error)
GetMatchesCurrentDay - Get matches current day of summoner by account ID: "/lol/match/v4/matchlists/by-account/"
func (*RiotAPIClient) GetMatchesCurrentMonth ¶
func (riotAPIClient *RiotAPIClient) GetMatchesCurrentMonth(accountID string) (*MatchlistDto, error)
GetMatchesCurrentMonth - Get matches current month of summoner by account ID: "/lol/match/v4/matchlists/by-account/"
func (*RiotAPIClient) GetMatchesCurrentYear ¶
func (riotAPIClient *RiotAPIClient) GetMatchesCurrentYear(accountID string) (*MatchlistDto, error)
GetMatchesCurrentYear - Get matches current year of summoner by account ID: "/lol/match/v4/matchlists/by-account/"
func (*RiotAPIClient) GetSummonerByName ¶
func (riotAPIClient *RiotAPIClient) GetSummonerByName(summonerName string) (*SummonerDTO, error)
GetSummonerByName - Get summoner by name: "/lol/summoner/v4/summoners/by-name/"
func (*RiotAPIClient) GetSummonerLeaguesByID ¶
func (riotAPIClient *RiotAPIClient) GetSummonerLeaguesByID(summonerID string) ([]LeagueEntryDTO, error)
GetSummonerLeaguesByID - Get leagues of summoner by ID: "/lol/league/v4/entries/by-summoner/"
func (*RiotAPIClient) GetSummonerMatchesByAccountID ¶
func (riotAPIClient *RiotAPIClient) GetSummonerMatchesByAccountID(accountID string) (*MatchlistDto, error)
GetSummonerMatchesByAccountID - Get matches of summoner by account ID: "/lol/match/v4/matchlists/by-account/"
type Summoner ¶
type Summoner struct { SummonerName string `json:"summonerName"` SummonerLevel int `json:"summonerLevel"` SummonerID string `json:"id"` AccountID string `json:"accountId"` Puuid string `json:"puuid"` ProfileIconID int `json:"profileIconId"` RevisionDate int `json:"revisionDate"` LeagueInfo []LeagueInfo `json:"leagueInfo"` TotalGames int `json:"totalGames"` MatchesInfo []MatchReferenceDto `json:"matchesInfo"` }
Summoner - summoner for API
func (*Summoner) WithLeagueInfo ¶
func (summoner *Summoner) WithLeagueInfo(leagueEntryDTO []LeagueEntryDTO)
WithLeagueInfo - add LeagueEntryDTO data in summoner
func (*Summoner) WithMatchesInfo ¶
func (summoner *Summoner) WithMatchesInfo(matchlistDto *MatchlistDto)
WithMatchesInfo - add MatchReferenceDto data in summoner
func (*Summoner) WithSummonerInfo ¶
func (summoner *Summoner) WithSummonerInfo(summonerDTO *SummonerDTO)
WithSummonerInfo - add SummonerDTO data in summoner
type SummonerBuilder ¶
type SummonerBuilder struct { ID string // contains filtered or unexported fields }
SummonerBuilder - builder summoner
type SummonerDTO ¶
type SummonerDTO struct { ID string `json:"id"` AccountID string `json:"accountId"` Puuid string `json:"puuid"` Name string `json:"name"` ProfileIconID int `json:"profileIconId"` RevisionDate int `json:"revisionDate"` SummonerLevel int `json:"summonerLevel"` }
SummonerDTO - summoner profile response