queries

package
v0.0.0-...-5129a00 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GamesQuery

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

GamesQuery is used for getting games from database

func NewGamesQuery

func NewGamesQuery(handle *gorm.DB, maxLimit int) *GamesQuery

NewGamesQuery return the new query used for retrieving games

func (*GamesQuery) FilterPlatforms

func (q *GamesQuery) FilterPlatforms(platforms []string) *GamesQuery

FilterPlatforms filters games by matching platforms uids, if not called games on all platforms are returned

func (*GamesQuery) FilterRegions

func (q *GamesQuery) FilterRegions(regions []string) *GamesQuery

FilterRegions filters games by matching their regions, if not called games from all regions are returned

func (*GamesQuery) FilterUIDs

func (q *GamesQuery) FilterUIDs(serialNumbers []string) *GamesQuery

FilterUIDs filters games by matching UID (platform:serial_no), if not called all games are returned

func (*GamesQuery) Get

func (q *GamesQuery) Get() GamesResult

Get retrives games and their total count

func (*GamesQuery) Limit

func (q *GamesQuery) Limit(limit int) *GamesQuery

Limit sets the maximum amount of games being returned It may exceed max limit set by the App config

func (*GamesQuery) Page

func (q *GamesQuery) Page(offset int) *GamesQuery

Page sets the multiplication of limit. Used for paging the results

type GamesResult

type GamesResult struct {
	Games []*models.Game
	Total int
}

GamesResult contains informations about games fetched from database

type LanguagesQuery

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

LanguagesQuery is responsible for returning the languages information from database

func NewLanguagesQuery

func NewLanguagesQuery(handle *gorm.DB) *LanguagesQuery

NewLanguagesQuery returns a query used for retrieving lanugages

func (*LanguagesQuery) Get

func (q *LanguagesQuery) Get() []models.Language

Get returns languages

type PlatformsQuery

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

PlatformsQuery is responsible for returning the platforms information from database

func NewPlatformsQuery

func NewPlatformsQuery(handle *gorm.DB) *PlatformsQuery

NewPlatformsQuery returns a query used for retrieving lanugages

func (*PlatformsQuery) FilterIndexed

func (q *PlatformsQuery) FilterIndexed(indexed bool) *PlatformsQuery

FilterIndexed filters platforms that are either with index or without

func (*PlatformsQuery) First

func (q *PlatformsQuery) First() models.Platform

First returns only first found platform

func (*PlatformsQuery) Get

func (q *PlatformsQuery) Get() []models.Platform

Get returns platforms

func (*PlatformsQuery) WithUID

func (q *PlatformsQuery) WithUID(uid string) *PlatformsQuery

WithUID filters platforms to only return platform with specified UID

type RegionsQuery

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

RegionsQuery is responsible for returning the regions information from database

func NewRegionsQuery

func NewRegionsQuery(handle *gorm.DB) *RegionsQuery

NewRegionsQuery returns a query used for retrieving lanugages

func (*RegionsQuery) Get

func (q *RegionsQuery) Get() []models.Region

Get returns regions

Jump to

Keyboard shortcuts

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