rest

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndpointHealth              = NewEndpoint("GET", "/health")
	EndpointGetModList          = NewEndpoint("GET", "/mods")
	EndpointGetModDetail        = NewEndpoint("GET", "/mod/:mod_id")
	EndpointGetModThumbnail     = NewEndpoint("GET", "/mod/:mod_id/thumbnail")
	EndpointGetModVersionList   = NewEndpoint("GET", "/mod/:mod_id/versions")
	EndpointGetModVersionDetail = NewEndpoint("GET", "/mod/:mod_id/version/:version_id")
	EndpointShareGame           = NewEndpoint("POST", "/share_game")
	EndpointUpdateShareGame     = NewEndpoint("PUT", "/share_game")
	EndpointDeleteShareGame     = NewEndpoint("DELETE", "/share_game")
	EndpointJoinGame            = NewEndpoint("GET", "/join_game")
)

Functions

This section is empty.

Types

type CompiledEndpoint

type CompiledEndpoint struct {
	Endpoint *Endpoint

	URL string
}

type Endpoint

type Endpoint struct {
	Method string
	Route  string
}

func NewEndpoint

func NewEndpoint(method, path string) *Endpoint

func (*Endpoint) Compile

func (e *Endpoint) Compile(values url.Values, params ...any) *CompiledEndpoint

type HealthStatus

type HealthStatus struct {
	Status           string   `json:"status"`
	WorkingVersion   string   `json:"working_version,omitempty"`
	DisabledVersions []string `json:"disabled_versions,omitempty"`
}

type JoinGameDownloadResponse added in v1.6.0

type JoinGameDownloadResponse struct {
	SessionID string    `json:"session_id"`
	Aupack    []byte    `json:"aupack"`
	Room      RoomInfo  `json:"room"`
	ExpiresAt time.Time `json:"expires_at"`
}

type RoomInfo added in v1.6.0

type RoomInfo struct {
	LobbyCode      string `json:"lobby_code,omitempty"`
	ServerIP       string `json:"server_ip,omitempty"`
	ServerPort     uint16 `json:"server_port,omitempty"`
	MatchMakerIp   string `json:"match_maker_ip,omitempty"`
	MatchMakerPort uint16 `json:"match_maker_port,omitempty"`
}

type ShareGameRequest added in v1.6.0

type ShareGameRequest struct {
	Aupack []byte   `json:"aupack"`
	Room   RoomInfo `json:"room"`
}

type ShareGameResponse added in v1.6.0

type ShareGameResponse struct {
	URL       string    `json:"url"`
	SessionID string    `json:"session_id"`
	HostKey   string    `json:"host_key"`
	ExpiresAt time.Time `json:"expires_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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