domain

package
v0.0.0-...-56beac2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BannedIpsCache

type BannedIpsCache interface {
	IsThisIPBanned(ctx context.Context, ip string) (bool, error)
	BanThisIP(ctx context.Context, ip string) error
}

type Game

type Game struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Data string `json:"data"`
}

func (*Game) MarshalJSON

func (r *Game) MarshalJSON() ([]byte, error)

type GameCache

type GameCache interface {
	GetByID(ctx context.Context, id string) (*string, error)
	Set(ctx context.Context, game Game) error
}

type GameRepository

type GameRepository interface {
	GetByID(ctx context.Context, id string) (*Game, error)
}

type Leaderboard

type Leaderboard struct {
	ID          int    `json:"id"`
	UID         string `json:"uid"`
	GID         string `json:"gid"`
	Name        string `json:"name"`
	Value1Order int8   `json:"v1_order"`
	Value2Order int8   `json:"v2_order"`
	Value3Order int8   `json:"v3_order"`
}

type LeaderboardData

type LeaderboardData struct {
	Name   string `json:"name"`
	Value1 int    `json:"value1"`
	Value2 int    `json:"value2"`
	Value3 int    `json:"value3"`
}

type LeaderboardDataCache

type LeaderboardDataCache interface {
	GetByUID(ctx context.Context, uid string) (*string, error)
	Set(ctx context.Context, uid string, list []LeaderboardData) error
}

type LeaderboardDataRepository

type LeaderboardDataRepository interface {
	GetByUID(ctx context.Context, uid string, offset int, count int) ([]LeaderboardData, error)
	GetPlayerPosition(ctx context.Context, lid string, pid string) (int, error)
	Insert(ctx context.Context, lid string, pid string, v1 int, v2 int, v3 int) error
}

type Player

type Player struct {
	ID     int    `json:"-"`
	UID    string `json:"uid"`
	Name   string `json:"-"`
	Banned bool   `json:"-"`
}

type PlayerRepository

type PlayerRepository interface {
	GetByUID(ctx context.Context, uid string) (*Player, error)
	Insert(ctx context.Context, player *Player) error
	Update(ctx context.Context, player *Player) error
}

Jump to

Keyboard shortcuts

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