api

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func New

func New(
	cfg config.Config,
	logger *zerolog.Logger,
	container container.Container,
) *API

func (*API) AddServer

func (a *API) AddServer(c *gin.Context)

AddServer godoc @Summary Add server @Description Add a new server by submitting its address @Tags servers @Accept json @Produce json @Param server body model.NewServer true "Server address" @Success 200 {object} model.Server @Success 202 "Server address has been submitted" @Router /servers [post]

func (*API) ListServers

func (a *API) ListServers(c *gin.Context)

ListServers godoc @Summary List servers @Description List servers that report to the master server as well as the servers discovered by other means @Tags servers @Produce json @Param gamevariant query string false "Game variant (SWAT 4, SWAT 4X, etc)" @Param gamever query string false "Game version (1.0, 1.1, etc)" @Param gametype query string false "Game mode (VIP Escort, CO-OP, etc)" @Param nopassworded query bool false "Hide password protected servers" @Param nofull query bool false "Hide full servers" @Param noempty query bool false "Hide empty servers" @Success 200 {array} model.Server @Router /servers [get]

func (*API) Status added in v0.7.0

func (a *API) Status(c *gin.Context)

func (*API) ViewServer

func (a *API) ViewServer(c *gin.Context)

ViewServer godoc @Summary View server detail @Description Return detailed information for a specific server @Tags servers @Produce json @Success 200 {object} model.ServerDetail @Router /servers/:address [get]

type Error

type Error struct {
	Error string
}

type ServerFilterForm

type ServerFilterForm struct {
	GameVariant    string `form:"gamevariant"`
	GameVer        string `form:"gamever"`
	GameType       string `form:"gametype"`
	HidePassworded bool   `form:"nopassworded"`
	HideFull       bool   `form:"nofull"`
	HideEmpty      bool   `form:"noempty"`
}

Jump to

Keyboard shortcuts

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