mongobackend

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mongobackend provides a MongoDB storage backend for use with the storage package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend represents the Mongo Backend

func NewBackend

func NewBackend(cfg config.MongoBackend) (*Backend, error)

NewBackend creates a new Mongo Backend

func (*Backend) GetChampionStatsByChampionIDGameVersionTierQueue

func (b *Backend) GetChampionStatsByChampionIDGameVersionTierQueue(championID, gameVersion, tier, queue string) (*storage.ChampionStatsStorage, error)

GetChampionStatsByChampionIDGameVersionTierQueue returns all stats specific to a certain game version, champion id and tier and queue

func (*Backend) GetChampionStatsSummaryByGameVersionTierQueue

func (b *Backend) GetChampionStatsSummaryByGameVersionTierQueue(gameVersion, tier, queue string) (*storage.ChampionStatsSummaryStorage, error)

GetChampionStatsSummaryByGameVersionTierQueue returns the stats summary for a specific game version, queue and tier

func (*Backend) GetChampions

func (b *Backend) GetChampions() (riotclient.ChampionsList, error)

GetChampions gets the champions list from storage

func (*Backend) GetChampionsCount

func (b *Backend) GetChampionsCount() (uint64, error)

GetChampionsCount gets the number of champions from storage

func (*Backend) GetChampionsTimeStamp

func (b *Backend) GetChampionsTimeStamp() time.Time

GetChampionsTimeStamp gets the timestamp of the stored champions list

func (*Backend) GetFreeRotation

func (b *Backend) GetFreeRotation() (*riotclient.FreeRotation, error)

GetFreeRotation gets the stored free champions rotation

func (*Backend) GetFreeRotationTimeStamp

func (b *Backend) GetFreeRotationTimeStamp() time.Time

GetFreeRotationTimeStamp gets the timestamp of the stored free champions rotation

func (*Backend) GetItemStatsByChampionIDGameVersion

func (b *Backend) GetItemStatsByChampionIDGameVersion(championID, gameVersion string) (*storage.ItemStatsStorage, error)

GetItemStatsByChampionIDGameVersion returns all item stats specific to a certain game version and champion id

func (*Backend) GetKnownGameVersions

func (b *Backend) GetKnownGameVersions() (*storage.GameVersions, error)

GetKnownGameVersions gets the stored known game versions

func (*Backend) GetLeagueByQueue

func (b *Backend) GetLeagueByQueue(league string, queue string) (*riotclient.LeagueListDTO, error)

func (*Backend) GetLeagueByQueueTimeStamp

func (b *Backend) GetLeagueByQueueTimeStamp(league string, queue string) (time.Time, error)

func (*Backend) GetLeaguesForSummoner

func (b *Backend) GetLeaguesForSummoner(summonerName string) (*storage.SummonerLeagues, error)

GetLeaguesForSummoner returns the stores League information for a certain Summoner identified by its name

func (*Backend) GetLeaguesForSummonerBySummonerID

func (b *Backend) GetLeaguesForSummonerBySummonerID(summonerID string) (*storage.SummonerLeagues, error)

GetLeaguesForSummonerBySummonerID returns the stores League information for a certain Summoner identified by its Summoner ID

func (*Backend) GetLeaguesForSummonerBySummonerIDTimeStamp

func (b *Backend) GetLeaguesForSummonerBySummonerIDTimeStamp(summonerID string) (time.Time, error)

GetLeaguesForSummonerBySummonerIDTimeStamp gets the timestamp of the stored Leagues for Summoner idenfitied by ID

func (*Backend) GetLeaguesForSummonerTimeStamp

func (b *Backend) GetLeaguesForSummonerTimeStamp(summonerName string) (time.Time, error)

GetLeaguesForSummonerTimeStamp gets the timestamp of the stored Leagues for Summoner idenfitied by name

func (*Backend) GetMatch

func (b *Backend) GetMatch(id uint64) (*riotclient.MatchDTO, error)

GetMatch retreives match data for given id

func (*Backend) GetMatchTimeLine

func (b *Backend) GetMatchTimeLine(matchID uint64) (*riotclient.MatchTimelineDTO, error)

func (*Backend) GetMatchesByGameVersion

func (b *Backend) GetMatchesByGameVersion(gameVersion string) (*riotclient.Matches, error)

GetMatchesByGameVersion returns all matches specific to a certain game version from Storage

func (*Backend) GetMatchesByGameVersionAndChampionID

func (b *Backend) GetMatchesByGameVersionAndChampionID(gameVersion string, championID uint64) (*riotclient.Matches, error)

GetMatchesByGameVersionAndChampionID returns all matches specific to a certain game version and champion id

func (*Backend) GetMatchesByGameVersionChampionIDMapBetweenQueueIDs

func (b *Backend) GetMatchesByGameVersionChampionIDMapBetweenQueueIDs(gameVersion string, championID uint64, mapID uint64, ltequeue uint64, gtequeue uint64) (*riotclient.Matches, error)

GetMatchesByGameVersionChampionIDMapBetweenQueueIDs returns all matches specific to a certain game version, champion id, map id and queue ids between and equal to ltequeue <= queueid <= gtequeue

func (*Backend) GetMatchesByGameVersionChampionIDMapQueue

func (b *Backend) GetMatchesByGameVersionChampionIDMapQueue(gameVersion string, championID uint64, mapID uint64, queueID uint64) (*riotclient.Matches, error)

GetMatchesByGameVersionChampionIDMapQueue returns all matches specific to a certain game version, champion id, map id and queue id

func (*Backend) GetMatchesCount

func (b *Backend) GetMatchesCount() (uint64, error)

GetMatchesCount returns the number of stored Matches in the Backend

func (*Backend) GetMatchesCursorByGameVersion

func (b *Backend) GetMatchesCursorByGameVersion(gameVersion string) (storage.QueryCursor, error)

GetMatchesCursorByGameVersion returns cursor to matches specific to a certain game version

func (*Backend) GetMatchesCursorByGameVersionChampionIDMapBetweenQueueIDs

func (b *Backend) GetMatchesCursorByGameVersionChampionIDMapBetweenQueueIDs(gameVersion string, championID uint64, mapID uint64, ltequeue uint64, gtequeue uint64) (storage.QueryCursor, error)

GetMatchesCursorByGameVersionChampionIDMapBetweenQueueIDs returns cursor to matches specific to a certain game version, champion id, map id and queue ids between and equal to ltequeue <= queueid <= gtequeue

func (*Backend) GetMatchesCursorByGameVersionMapBetweenQueueIDs

func (b *Backend) GetMatchesCursorByGameVersionMapBetweenQueueIDs(gameVersion string, mapID uint64, ltequeue uint64, gtequeue uint64) (storage.QueryCursor, error)

GetMatchesCursorByGameVersionMapBetweenQueueIDs returns cursor to matches specific to a certain game version, map id and queue ids between and equal to ltequeue <= queueid <= gtequeue

func (*Backend) GetMatchesCursorByGameVersionMapQueueID

func (b *Backend) GetMatchesCursorByGameVersionMapQueueID(gameVersion string, mapID uint64, queueID uint64) (storage.QueryCursor, error)

GetMatchesCursorByGameVersionMapQueueID returns cursor to matches specific to a certain game version, map id and queue id

func (*Backend) GetStorageSummary

func (b *Backend) GetStorageSummary() (storage.Summary, error)

GetStorageSummary returns stats about the stored elements in the Backend

func (*Backend) GetSummonerByAccountID

func (b *Backend) GetSummonerByAccountID(accountID string) (*storage.Summoner, error)

GetSummonerByAccountID retrieves a summoner identified by its Account ID

func (*Backend) GetSummonerByAccountIDTimeStamp

func (b *Backend) GetSummonerByAccountIDTimeStamp(accountID string) time.Time

GetSummonerByAccountIDTimeStamp retrieves a summoners time stamp by its Account ID

func (*Backend) GetSummonerByName

func (b *Backend) GetSummonerByName(name string) (*storage.Summoner, error)

GetSummonerByName retrieves a summoner by name

func (*Backend) GetSummonerByNameTimeStamp

func (b *Backend) GetSummonerByNameTimeStamp(name string) time.Time

GetSummonerByNameTimeStamp gets the Timestamp when the data was stored for the Summoner specified by name

func (*Backend) GetSummonerByPUUID

func (b *Backend) GetSummonerByPUUID(PUUID string) (*storage.Summoner, error)

GetSummonerByPUUID retrieves a summoner identified by its PUUID

func (*Backend) GetSummonerByPUUIDTimeStamp

func (b *Backend) GetSummonerByPUUIDTimeStamp(PUUID string) time.Time

GetSummonerByPUUIDTimeStamp retrieves a summoners time stamp by its PUUID

func (*Backend) GetSummonerBySummonerID

func (b *Backend) GetSummonerBySummonerID(summonerID string) (*storage.Summoner, error)

GetSummonerBySummonerID retrieves a summoner identified by its Summoner ID

func (*Backend) GetSummonerBySummonerIDTimeStamp

func (b *Backend) GetSummonerBySummonerIDTimeStamp(summonerID string) time.Time

GetSummonerBySummonerIDTimeStamp retrieves a summoners time stamp by its Summoner ID

func (*Backend) GetSummonerSpells

func (b *Backend) GetSummonerSpells() (*riotclient.SummonerSpellsList, error)

GetSummonerSpells gets the summoner spells list from storage

func (*Backend) GetSummonerSpellsStatsByChampionIDGameVersionTierQueue

func (b *Backend) GetSummonerSpellsStatsByChampionIDGameVersionTierQueue(championID, gameVersion, tier, queue string) (*storage.SummonerSpellsStatsStorage, error)

GetSummonerSpellsStatsByChampionIDGameVersionTierQueue returns all stats specific to a certain game version, champion id and tier and queue

func (*Backend) GetSummonerSpellsTimeStamp

func (b *Backend) GetSummonerSpellsTimeStamp() time.Time

GetSummonerSpellsTimeStamp gets the timestamp of the stored champions list

func (*Backend) GetSummonersCount

func (b *Backend) GetSummonersCount() (uint64, error)

GetSummonersCount returns the number of stored Summoners in the Backend

func (*Backend) StoreChampionStats

func (b *Backend) StoreChampionStats(data *storage.ChampionStatsStorage) error

StoreChampionStats stores new champion stats in storage

func (*Backend) StoreChampionStatsSummary

func (b *Backend) StoreChampionStatsSummary(data *storage.ChampionStatsSummaryStorage) error

StoreChampionStatsSummary stores a Champion Statistics Summary in the db

func (*Backend) StoreChampions

func (b *Backend) StoreChampions(championList riotclient.ChampionsList) error

StoreChampions stores a new champions list

func (*Backend) StoreFreeRotation

func (b *Backend) StoreFreeRotation(data *riotclient.FreeRotation) error

StoreFreeRotation stores a new free champions rotation list

func (*Backend) StoreItemStats

func (b *Backend) StoreItemStats(data *storage.ItemStatsStorage) error

StoreItemStats stores new champion item stats in storage

func (*Backend) StoreKnownGameVersions

func (b *Backend) StoreKnownGameVersions(data *storage.GameVersions) error

StoreKnownGameVersions stores a new list of known game versions

func (*Backend) StoreLeague

func (b *Backend) StoreLeague(*riotclient.LeagueListDTO) error

func (*Backend) StoreLeaguesForSummoner

func (b *Backend) StoreLeaguesForSummoner(leagues *storage.SummonerLeagues) error

StoreLeaguesForSummoner stores new Summoner League information data

func (*Backend) StoreMatch

func (b *Backend) StoreMatch(data *riotclient.MatchDTO) error

StoreMatch stores new match data

func (*Backend) StoreMatchTimeLine

func (b *Backend) StoreMatchTimeLine(data *riotclient.MatchTimelineDTO) error

func (*Backend) StoreSummoner

func (b *Backend) StoreSummoner(data *storage.Summoner) error

StoreSummoner stores new Summoner data

func (*Backend) StoreSummonerSpells

func (b *Backend) StoreSummonerSpells(summnerSpellsList *riotclient.SummonerSpellsList) error

StoreSummonerSpells stores a new champions list

func (*Backend) StoreSummonerSpellsStats

func (b *Backend) StoreSummonerSpellsStats(data *storage.SummonerSpellsStatsStorage) error

StoreSummonerSpellsStats stores new summonerspells stats in storage

type MatchCursor

type MatchCursor struct {
	// contains filtered or unexported fields
}

MatchCursor is the cursor implementation for Match queries

func (*MatchCursor) Close

func (c *MatchCursor) Close() error

Close the cursor

func (*MatchCursor) Decode

func (c *MatchCursor) Decode(i interface{}) error

Decode decodes the current result

func (*MatchCursor) Next

func (c *MatchCursor) Next() bool

Next gets the next result from the cursor. Returns true if there were no errors and there is a next result.

Jump to

Keyboard shortcuts

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