elasticsearch

package
v0.0.0-...-a97d171 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexAchievements = "achievements"
	IndexBundles      = "bundles"
	IndexGroups       = "groups"
	IndexArticles     = "articles"
	IndexApps         = "apps"
	IndexGlobal       = "global"
	IndexPlayers      = "players"
)

Variables

View Source
var ErrNoResult = errors.New("no result")

Functions

func AggregateArticleFeeds

func AggregateArticleFeeds() (aggregations []helpers.TupleStringInt, err error)

func AggregatePlayerCountries

func AggregatePlayerCountries() (aggregations map[string]int64, err error)

func DeleteAndRebuildAchievementsIndex

func DeleteAndRebuildAchievementsIndex()

noinspection GoUnusedExportedFunction

func DeleteAndRebuildAppsIndex

func DeleteAndRebuildAppsIndex()

noinspection GoUnusedExportedFunction

func DeleteAndRebuildArticlesIndex

func DeleteAndRebuildArticlesIndex()

noinspection GoUnusedExportedFunction

func DeleteAndRebuildBundlesIndex

func DeleteAndRebuildBundlesIndex()

noinspection GoUnusedExportedFunction

func DeleteAndRebuildGroupsIndex

func DeleteAndRebuildGroupsIndex()

noinspection GoUnusedExportedFunction

func DeleteAndRebuildPlayersIndex

func DeleteAndRebuildPlayersIndex()

noinspection GoUnusedExportedFunction

func DeleteDocument

func DeleteDocument(index string, key string) error

func GetMostExpensiveApp

func GetMostExpensiveApp(code steamapi.ProductCC) (top float64, err error)

func IndexAchievement

func IndexAchievement(achievement Achievement) error

func IndexAchievementBulk

func IndexAchievementBulk(achievements map[string]Achievement) error

func IndexApp

func IndexApp(a App) error

func IndexArticle

func IndexArticle(article Article) error

func IndexArticlesBulk

func IndexArticlesBulk(articles map[string]Article) error

func IndexBundle

func IndexBundle(bundle Bundle) error

func IndexGroup

func IndexGroup(g Group) error

func IndexPlayer

func IndexPlayer(p Player) error

func UpdateDocumentFields

func UpdateDocumentFields(index string, key string, doc map[string]interface{}) error

Types

type Achievement

type Achievement struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Icon        string  `json:"icon"`
	Description string  `json:"description"`
	Hidden      bool    `json:"hidden"`
	Completed   float64 `json:"completed"`
	AppID       int     `json:"app_id"`
	AppName     string  `json:"app_name"`
	AppOwners   int64   `json:"app_owners"`
	NameMarked  string  `json:"-"`
	Score       float64 `json:"-"`
}

func SearchAppAchievements

func SearchAppAchievements(offset int, search string, sorters []elastic.Sorter) (achievements []Achievement, total int64, err error)

func (Achievement) GetAppName

func (achievement Achievement) GetAppName() string

func (Achievement) GetAppPath

func (achievement Achievement) GetAppPath() string

func (Achievement) GetCompleed

func (achievement Achievement) GetCompleed() string

func (Achievement) GetIcon

func (achievement Achievement) GetIcon() string

func (Achievement) GetKey

func (achievement Achievement) GetKey() string

type App

type App struct {
	AchievementsAvg     float64               `json:"achievements_avg"`
	AchievementsCount   int                   `json:"achievements_counts"`
	AchievementsIcons   []helpers.Tuple       `json:"achievements_icons"`
	Aliases             []string              `json:"aliases"`
	Background          string                `json:"background"`
	Categories          []int                 `json:"categories"`
	Developers          []int                 `json:"developers"`
	FollowersCount      int                   `json:"followers"`
	Genres              []int                 `json:"genres"`
	GroupID             string                `json:"group_id"`
	Icon                string                `json:"icon"`
	ID                  int                   `json:"id"`
	MicroTrailor        string                `json:"micro_trailor"`
	Movies              string                `json:"movies"`
	MoviesCount         int                   `json:"movies_count"`
	Name                string                `json:"name"`
	NameLC              string                `json:"name_lc"`
	Platforms           []string              `json:"platforms"`
	PlayersCount        int                   `json:"players"` // Peak week
	Prices              helpers.ProductPrices `json:"prices"`
	Publishers          []int                 `json:"publishers"`
	ReleaseDateOriginal string                `json:"release_date_original"`
	ReleaseDate         int64                 `json:"release_date"`
	ReleaseDateRounded  int64                 `json:"release_date_rounded"`
	ReviewScore         float64               `json:"score"`
	ReviewsCount        int                   `json:"reviews_count"`
	Screenshots         string                `json:"screenshots"`
	ScreenshotsCount    int                   `json:"screenshots_count"`
	Tags                []int                 `json:"tags"`
	Trend               float64               `json:"trend"`
	Type                string                `json:"type"`
	WishlistAvg         float64               `json:"wishlist_avg"`
	WishlistCount       int                   `json:"wishlist_count"`
	NameMarked          string                `json:"-"`
	Score               float64               `json:"-"`
}

func GetUpcomingGames

func GetUpcomingGames() (apps []App, err error)

func SearchAppsAdvanced

func SearchAppsAdvanced(offset int, limit int, search string, sorters []elastic.Sorter, boolQuery *elastic.BoolQuery) (apps []App, total int64, err error)

func SearchAppsRandom

func SearchAppsRandom(filters []elastic.Query) (app App, count int64, err error)

func SearchAppsSimple

func SearchAppsSimple(limit int, search string) (apps []App, err error)

func (App) GetBackground

func (app App) GetBackground() string

For an interface

func (app App) GetCommunityLink() string

func (App) GetFollowers

func (app App) GetFollowers() string

func (App) GetGroupID

func (app App) GetGroupID() string

func (App) GetHeaderImage

func (app App) GetHeaderImage() string

func (App) GetID

func (app App) GetID() int

func (App) GetIcon

func (app App) GetIcon() string

func (App) GetIconAbsolute

func (app App) GetIconAbsolute() string

func (App) GetMarkedName

func (app App) GetMarkedName() string

func (App) GetMovies

func (app App) GetMovies() (movies []helpers.AppVideo)

func (App) GetName

func (app App) GetName() string

func (App) GetPath

func (app App) GetPath() string

func (App) GetPathAbsolute

func (app App) GetPathAbsolute() string
func (app App) GetPlayLink() template.URL

func (App) GetPlayersPeakWeek

func (app App) GetPlayersPeakWeek() int

func (App) GetPrices

func (app App) GetPrices() (prices helpers.ProductPrices)

func (App) GetReleaseDateNice

func (app App) GetReleaseDateNice() string

func (App) GetReleaseDateNiceRounded

func (app App) GetReleaseDateNiceRounded() string

func (App) GetReviewScore

func (app App) GetReviewScore() string

func (App) GetScreenshots

func (app App) GetScreenshots() (screenshots []helpers.AppImage)
func (app App) GetStoreLink() string

func (App) GetType

func (app App) GetType() string

type Article

type Article struct {
	ID          int64   `json:"id"`
	Title       string  `json:"title"`
	Author      string  `json:"author"`
	Body        string  `json:"body"`
	Feed        string  `json:"feed"`
	FeedName    string  `json:"feed_name"`
	AppID       int     `json:"app_id"`
	AppName     string  `json:"app_name"`
	AppIcon     string  `json:"app_icon"`
	Time        int64   `json:"time"`
	ArticleIcon string  `json:"icon"`
	TitleMarked string  `json:"-"`
	Score       float64 `json:"-"`
}

func SearchArticles

func SearchArticles(offset int, limit int, sorters []elastic.Sorter, search string, filters []elastic.Query) (articles []Article, total int64, err error)

func (Article) GetAppIcon

func (article Article) GetAppIcon() string

func (Article) GetAppName

func (article Article) GetAppName() string

func (Article) GetAppPath

func (article Article) GetAppPath() string

func (Article) GetArticleIcon

func (article Article) GetArticleIcon() string

func (Article) GetBody

func (article Article) GetBody() template.HTML

func (Article) GetBodyTruncated

func (article Article) GetBodyTruncated() template.HTML

func (Article) GetDate

func (article Article) GetDate() string

func (Article) GetFeedName

func (article Article) GetFeedName() string

func (Article) GetHeaderImage

func (article Article) GetHeaderImage() string

460 x 215

func (Article) OutputForJSON

func (article Article) OutputForJSON() []interface{}

type Bundle

type Bundle struct {
	Apps            int                        `json:"apps"`
	CreatedAt       int64                      `json:"created_at"`
	Discount        int                        `json:"discount"`
	DiscountHighest int                        `json:"discount_highest"`
	DiscountLowest  int                        `json:"discount_lowest"`
	DiscountSale    int                        `json:"discount_sale"`
	Giftable        bool                       `json:"giftable"`
	Icon            string                     `json:"icon"`
	ID              int                        `json:"id"`
	Image           string                     `json:"image"`
	Name            string                     `json:"name"`
	OnSale          bool                       `json:"on_sale"`
	Packages        int                        `json:"packages"`
	Prices          map[steamapi.ProductCC]int `json:"prices"`
	PricesSale      map[steamapi.ProductCC]int `json:"prices_sale"`
	Type            string                     `json:"type"`
	UpdatedAt       int64                      `json:"updated_at"`
	NameMarked      string                     `json:"-"`
	Score           float64                    `json:"-"`
}

func SearchBundles

func SearchBundles(offset int, limit int, search string, sorters []elastic.Sorter, filters []elastic.Query) (bundles []Bundle, total int64, err error)

func (Bundle) GetApps

func (bundle Bundle) GetApps() int

func (Bundle) GetCreated

func (bundle Bundle) GetCreated() time.Time

func (Bundle) GetDiscount

func (bundle Bundle) GetDiscount() int

func (Bundle) GetDiscountHighest

func (bundle Bundle) GetDiscountHighest() int

func (Bundle) GetDiscountSale

func (bundle Bundle) GetDiscountSale() int

func (Bundle) GetID

func (bundle Bundle) GetID() int

func (Bundle) GetName

func (bundle Bundle) GetName() string

func (Bundle) GetPackages

func (bundle Bundle) GetPackages() int

func (Bundle) GetPath

func (bundle Bundle) GetPath() string

func (Bundle) GetPrices

func (bundle Bundle) GetPrices() map[steamapi.ProductCC]int

func (Bundle) GetPricesFormatted

func (bundle Bundle) GetPricesFormatted() (ret map[steamapi.ProductCC]string)

func (Bundle) GetPricesSaleFormatted

func (bundle Bundle) GetPricesSaleFormatted() map[steamapi.ProductCC]string

func (Bundle) GetScore

func (bundle Bundle) GetScore() float64
func (bundle Bundle) GetStoreLink() string

func (Bundle) GetType

func (bundle Bundle) GetType() string

func (Bundle) GetUpdated

func (bundle Bundle) GetUpdated() time.Time

func (Bundle) IsGiftable

func (bundle Bundle) IsGiftable() bool

func (Bundle) OutputForJSON

func (bundle Bundle) OutputForJSON() (output []interface{})

type Group

type Group struct {
	ID           string  `json:"id"`
	Name         string  `json:"name"`
	URL          string  `json:"url"`
	Abbreviation string  `json:"abbreviation"`
	Headline     string  `json:"headline"`
	Icon         string  `json:"icon"`
	Members      int     `json:"members"`
	Trend        float64 `json:"trend"`
	Error        bool    `json:"error"`
	Primaries    int     `json:"primaries"`
	NameMarked   string  `json:"-"`
	Score        float64 `json:"-"`
}

func SearchGroups

func SearchGroups(offset int, limit int, sorters []elastic.Sorter, search string, errors string) (groups []Group, aggregations map[string]map[string]int64, total int64, err error)

func (Group) GetAbbr

func (group Group) GetAbbr() string
func (group Group) GetGameLink() string
func (group Group) GetGroupLink() string

func (Group) GetHeadline

func (group Group) GetHeadline() string

func (Group) GetIcon

func (group Group) GetIcon() string

func (Group) GetName

func (group Group) GetName() string

func (Group) GetNameMarked

func (group Group) GetNameMarked() string

func (Group) GetPath

func (group Group) GetPath() string

func (Group) GetPathAbsolute

func (group Group) GetPathAbsolute() string

func (Group) GetTrend

func (group Group) GetTrend() string

type Player

type Player struct {
	ID                   int64                      `json:"id"`
	PersonaName          string                     `json:"name"`
	PersonaNameRecent    []string                   `json:"name_recent"`
	VanityURL            string                     `json:"url"`
	Avatar               string                     `json:"avatar"`
	Continent            string                     `json:"continent"`
	CountryCode          string                     `json:"country_code"`
	StateCode            string                     `json:"state_code"`
	LastBan              int64                      `json:"last_ban"`
	GameBans             int                        `json:"game_bans"`
	VACBans              int                        `json:"vac_bans"`
	Level                int                        `json:"level"`
	PlayTime             int                        `json:"play_time"`
	Badges               int                        `json:"badges"`
	BadgesFoil           int                        `json:"badges_foil"`
	Games                int                        `json:"games"`
	Achievements         int                        `json:"achievements"`
	Achievements100      int                        `json:"achievements_100"`
	AwardsGivenCount     int                        `json:"awards_given_count"`
	AwardsGivenPoints    int                        `json:"awards_given_points"`
	AwardsReceivedCount  int                        `json:"awards_received_count"`
	AwardsReceivedPoints int                        `json:"awards_received_points"`
	Ranks                map[helpers.RankMetric]int `json:"ranks"`
	PersonaNameMarked    string                     `json:"-"`
	Score                float64                    `json:"-"`
}

func SearchPlayers

func SearchPlayers(limit int, offset int, search string, sorters []elastic.Sorter, filters []elastic.Query) (players []Player, total int64, err error)

func (Player) GetAchievements

func (player Player) GetAchievements() int

func (Player) GetAvatar

func (player Player) GetAvatar() string

func (Player) GetAvatar2

func (player Player) GetAvatar2() string

func (Player) GetAvatarAbsolute

func (player Player) GetAvatarAbsolute() string

func (Player) GetBadges

func (player Player) GetBadges() int

func (Player) GetBadgesFoil

func (player Player) GetBadgesFoil() int
func (player Player) GetCommunityLink() string

func (Player) GetCountry

func (player Player) GetCountry() string

func (Player) GetFlag

func (player Player) GetFlag() string

func (Player) GetGameBans

func (player Player) GetGameBans() int

func (Player) GetGamesCount

func (player Player) GetGamesCount() int

func (Player) GetLastBan

func (player Player) GetLastBan() time.Time

func (Player) GetLevel

func (player Player) GetLevel() int

func (Player) GetName

func (player Player) GetName() string

func (Player) GetNameMarked

func (player Player) GetNameMarked() string

func (Player) GetPath

func (player Player) GetPath() string

func (Player) GetPathAbsolute

func (player Player) GetPathAbsolute() string

func (Player) GetPlaytime

func (player Player) GetPlaytime() int

func (Player) GetRanks

func (player Player) GetRanks() map[helpers.RankMetric]int

func (Player) GetVACBans

func (player Player) GetVACBans() int

Jump to

Keyboard shortcuts

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