repository

package
v0.0.0-...-e246b8e Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GAMES_BATCH_SIZE_LIMIT int = 10
	ErrDbConnection            = "Failed to connect database."
)

Functions

func CheckSocialTypes

func CheckSocialTypes(db *gorm.DB, profile *entity.Profile) error

func NewDBDialector

func NewDBDialector(conf *DBConfig) gorm.Dialector

Types

type DBConfig

type DBConfig struct {
	Host     string
	Port     string
	User     string
	DBName   string
	Password string
	SSL      bool
	TimeZone string
}

type GamelistRepository

type GamelistRepository interface {
	SaveGame(game entity.GameProperties) error
	GetAllGames() ([]entity.GameProperties, error)
	GetAllGamesTyped(nickname string, last uint64, batchSize int) ([]entity.TypedGameListProperties, error)
	GetUserGameList(nickname string) ([]entity.TypedGameListProperties, error)
	SearchGames(name string) ([]entity.GameSearchResult, error)
	GetGameDetails(nickname string, id uint64) (*entity.GameDetailsResponse, error)

	CreateListType(listType entity.ListType) error
	GetAllListTypes() ([]entity.ListType, error)
	ListGame(nickname string, gameId uint64, listType uint64) error

	SaveGenre(genre entity.Genre) error
	GetAllGenres() ([]entity.Genre, error)

	SavePlatform(platform entity.Platform) error
	GetAllPlatforms() ([]entity.Platform, error)

	CreateProfile(profile entity.Profile) error
	SaveProfile(profile entity.Profile) error
	GetAllProfiles() ([]entity.ProfileInfo, error)
	GetProfile(login entity.ProfileCreds) (*entity.Profile, error)

	SaveRefreshToken(nickname string, tokenString string) error
	FindRefreshToken(nickname string, tokenString string) error
	DeleteRefreshToken(tokenString string) error
	DeleteAllUserRefreshTokens(nickname string) error

	SaveSocialType(socialType entity.SocialType) error
	GetAllSocialTypes() ([]entity.SocialType, error)
}

func NewGamelistRepository

func NewGamelistRepository(dbName string, dialector gorm.Dialector, loggerConf logger.Config) GamelistRepository

Jump to

Keyboard shortcuts

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