handler

package
v0.0.0-...-8c4cb7d Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LobbyHandler

type LobbyHandler interface {
	// GetServersByPage returns server list from database by given queryOptions
	GetServersByPage(ctx context.Context, queryOptions types.QueryLobbyServersOptions) (types.PageResult[types.QueryLobbyServersResp], error)
	// ClearExpiredServers remove expired servers from database
	ClearExpiredServers(ctx context.Context, ttl time.Duration) (int64, int64, error)
	// GetServerDetails returns details information for specific server
	GetServerDetails(ctx context.Context, region, rowId string) (types.QueryLobbyServerDetailResp, error)
	// GetStatisticInfo returns statistics information for specific period
	GetStatisticInfo(ctx context.Context, before, until, tail int64, duration time.Duration) ([]repo.LobbyStatisticInfo, error)

	// GetAllServersFromLobby collects and returns server information from klei lobby server
	GetAllServersFromLobby(ctx context.Context, limit int, ts int64) ([]repo.LobbyServer, error)
	// SyncLocalServers collects server information from klei, process and store them into database,
	// then return how many records has been stored
	SyncLocalServers(ctx context.Context, limit int) (int, error)
}

type LobbyMongoHandler

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

func NewLobbyMongoHandler

func NewLobbyMongoHandler(lobbyRepo *repo.LobbyRepo, statisticRepo *repo.LobbyStatisticRepo, lobby *lobbyapi.Client, geoip *geoip2.Reader) *LobbyMongoHandler

func (*LobbyMongoHandler) ClearExpiredServers

func (l *LobbyMongoHandler) ClearExpiredServers(ctx context.Context, ttl time.Duration) (int64, int64, error)

func (*LobbyMongoHandler) GetAllServersFromLobby

func (l *LobbyMongoHandler) GetAllServersFromLobby(ctx context.Context, limit int, ts int64) ([]repo.LobbyServer, error)

GetAllServersFromLobby returns all lobby servers in parallel. Using limit params to limit the number of goroutine

func (*LobbyMongoHandler) GetServerDetails

func (l *LobbyMongoHandler) GetServerDetails(ctx context.Context, region, rowId string) (types.QueryLobbyServerDetailResp, error)

func (*LobbyMongoHandler) GetServersByPage

func (*LobbyMongoHandler) GetStatisticInfo

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

func (*LobbyMongoHandler) StatisticServers

func (l *LobbyMongoHandler) StatisticServers(ctx context.Context, ts int64, servers []repo.LobbyServer) error

func (*LobbyMongoHandler) SyncLocalServers

func (l *LobbyMongoHandler) SyncLocalServers(ctx context.Context, limit int) (int, error)

type ModHandler

type ModHandler interface {
	SearchModList(ctx context.Context, queryOption types.SearchModsOption) (publishedfile.FileList, error)
}

type WorkShopModHandler

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

func NewWorkShopHandler

func NewWorkShopHandler(steamCLI *steamapi.Client) *WorkShopModHandler

func (*WorkShopModHandler) SearchModList

func (w *WorkShopModHandler) SearchModList(ctx context.Context, queryOption types.SearchModsOption) (publishedfile.FileList, error)

Jump to

Keyboard shortcuts

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