types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountConnectionsMAX

func CountConnectionsMAX() int

Types

type CreateRoomRequest

type CreateRoomRequest struct {
	TTL         string      `json:"time_to_live"`
	GameConfigs GameConfigs `json:"gameConfigs"`
}

type GameConfigExecutor

type GameConfigExecutor interface {
	Name() string
	Execute(clientInfo tokentype.Info, config SortingConfig, newUserData interface{}, oldResult GameConfigResults) (newResult GameConfigResults, err error)
}

type GameConfigResults

type GameConfigResults struct {
	GameID uuid.UUID              `json:"game_id"`
	RoomID uuid.UUID              `json:"room_id"`
	Result map[string]interface{} `json:"result"`
}

type GameConfigs

type GameConfigs struct {
	GameID        uuid.UUID       `json:"game_id" bson:"_id"`
	SortingConfig []SortingConfig `json:"sorting_config" bson:"sorting_config"`
	IsExists      bool            `json:"-"`
}

func (*GameConfigs) RemoveSortingConfig

func (g *GameConfigs) RemoveSortingConfig(name string)

type ParamMetadata

type ParamMetadata struct {
	ColumnName string `json:"column_name" bson:"column_name"`
	ValueType  string `json:"value_type" bson:"value_type"`
}

type RequestSetMessage

type RequestSetMessage struct {
	Server *uuid.UUID `json:"server,omitempty"`
	Token  string     `json:"token,omitempty"`
	Data   any        `json:"data"`
}

type ResponseGetMessage

type ResponseGetMessage struct {
	DataArray []any `json:"dataArray"`
}

type Settings

type Settings struct {
	ServerType          string `json:"serverType"`
	ServerPort          string `json:"serverPort"`
	ConnectionPort      string `json:"connectionPort"`
	ServerAddress       string `json:"serverAddress"`
	MaxConnections      int    `json:"maxConnections"`
	MaxRequestPerSecond int    `json:"maxRequestPerSecond"`
}

func NewSettings

func NewSettings() (settings Settings)

type SortingConfig

type SortingConfig struct {
	Name            string             `json:"name" bson:"name"`
	Params          []ParamMetadata    `json:"params" bson:"params"`
	UseOnServerType string             `json:"use_on_server_type" bson:"use_on_server_type"`
	ResultName      string             `json:"result_name" bson:"result_name"`
	ResultType      string             `json:"result_type" bson:"result_type"`
	Executor        GameConfigExecutor `json:"-"`
}

Jump to

Keyboard shortcuts

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