repo

package
v0.0.0-...-d2de476 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LobbyRepo

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

func NewLobbyRepo

func NewLobbyRepo(ctx context.Context, db *qmgo.QmgoClient) (*LobbyRepo, error)

NewLobbyRepo returns new lobby mongo db operator

func (*LobbyRepo) FindServers

func (l *LobbyRepo) FindServers(ctx context.Context, page, size int, sort string, filter bson.M) (types.PageResult[LobbyServer], error)

FindServers returns list of servers by page

func (*LobbyRepo) InsertManyServers

func (l *LobbyRepo) InsertManyServers(ctx context.Context, servers []LobbyServer) (int, error)

func (*LobbyRepo) RemoveServers

func (l *LobbyRepo) RemoveServers(ctx context.Context, filter bson.M) (int64, int64, error)

RemoveServers returns deletedCount and total count after removing the specified servers

type LobbyServer

type LobbyServer struct {
	// geo info
	Region       string   `bson:"region"`
	Continent    string   `bson:"continent"`
	Area         string   `bson:"area"`
	City         string   `bson:"city"`
	PlatformName string   `bson:"platform_name"`
	TagNames     []string `bson:"tag_names"`

	// created at timestamp
	CreatedAt       int64 `bson:"created_at"`
	lobbyapi.Server `bson:"inline"`
}

type LobbyServerDetails

type LobbyServerDetails struct {
	Area                   string
	CreatedAt              int64
	lobbyapi.ServerDetails `bson:"inline"`
}

type LobbyStatisticInfo

type LobbyStatisticInfo struct {
	TotalServers  int64 `json:"totalServers" bson:"totalServers"`
	OnlinePlayers int64 `json:"onlinePlayers" bson:"onlinePlayers"`

	Platforms []LobbyStatisticItem `json:"platforms" bson:"platforms"`
	Area      []LobbyStatisticItem `json:"area" bson:"area"`
	Ts        int64                `json:"ts" bson:"ts"`
}

type LobbyStatisticItem

type LobbyStatisticItem struct {
	Label         string `json:"label:" bson:"label"`
	TotalServers  int64  `json:"totalServers" bson:"totalServers"`
	OnlinePlayers int64  `json:"onlinePlayers" bson:"onlinePlayers"`
}

type LobbyStatisticRepo

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

func NewLobbyStatisticRepo

func NewLobbyStatisticRepo(cli *qmgo.QmgoClient) *LobbyStatisticRepo

func (*LobbyStatisticRepo) GetMany

func (l *LobbyStatisticRepo) GetMany(ctx context.Context, before, until, tail int64, duration time.Duration) ([]LobbyStatisticInfo, error)

func (*LobbyStatisticRepo) InsertOne

func (l *LobbyStatisticRepo) InsertOne(ctx context.Context, data LobbyStatisticInfo) error

Jump to

Keyboard shortcuts

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