rest

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	// ID is the item identifier.
	ID string `json:"id"`

	// Name is the item name.
	Name string `json:"name"`

	// Description is the item description.
	Description string `json:"description"`

	// OwnerID is the PlayerID of the item owner.
	OwnerID string `json:"ownerID"`

	// LocationID is the LocationID of the item's location.
	LocationID ItemLocationID `json:"locationID"`

	// Created is the time of the item's creation.
	Created arcade.Timestamp `json:"created"`

	// Updated is the time the item was last updated.
	Updated arcade.Timestamp `json:"updated"`
}

Item holds an item's information, and is sent in a response.

type ItemCreateRequest

type ItemCreateRequest struct {
	ItemRequest
}

ItemCreateRequest is used to request an item be created.

type ItemLocationID

type ItemLocationID struct {
	// ID is the location identifier. This can correspond the the ID of a room, player or item.
	ID string `json:"id"`

	// Type is the type of location. This can be "room", "player" or "item".
	Type string `json:"type"`
}

ItemLocationID holds the locationID of the item, and the type of location.

type ItemRequest

type ItemRequest struct {
	// Name is the name of the item.
	Name string `json:"name"`

	// Description is the description of the item.
	Description string `json:"description"`

	// OwnerID is the ID of the owner of the item.
	OwnerID string `json:"ownerID"`

	// LocationID is the ID of the location of the item.
	LocationID ItemLocationID `json:"locationID"`
}

ItemRequest is used to request an item be created or updated.

type ItemResponse

type ItemResponse struct {
	// Item returns the information about an item.
	Item Item `json:"item"`
}

ItemResponse returns an item.

type ItemUpdateRequest

type ItemUpdateRequest struct {
	ItemRequest
}

ItemUpdateRequest is used to request an item be updated.

type ItemsResponse

type ItemsResponse struct {
	// Items returns the information about multiple items.
	Items []Item `json:"items"`
}

ItemsResponse returns multiple items.

type Link struct {
	// ID is the link identifier.
	ID string `json:"id"`

	// Name is the link name.
	Name string `json:"name"`

	// Description is the link description.
	Description string `json:"description"`

	// OwnerID is the PlayerID of the link owner.
	OwnerID string `json:"ownerID"`

	// LocationID is the RoomID of the link's location.
	LocationID string `json:"locationID"`

	// DestinationID is the RoomID of the link's destination.
	DestinationID string `json:"destinationID"`

	// Created is the time of the link's creation.
	Created arcade.Timestamp `json:"created"`

	// Updated is the time the link was last updated.
	Updated arcade.Timestamp `json:"updated"`
}

Link holds a link's information, and is sent in a response.

type LinkCreateRequest

type LinkCreateRequest struct {
	LinkRequest
}

LinkCreateRequest is used to request an link be created.

type LinkRequest

type LinkRequest struct {
	// Name is the name of the link.
	Name string `json:"name"`

	// Description is the description of the link.
	Description string `json:"description"`

	// OwnerID is the ID of the owner of the link.
	OwnerID string `json:"ownerID"`

	// LocationID is the ID of the location of the link.
	LocationID string `json:"locationID"`

	// DestinationID is the ID of the destination of the link.
	DestinationID string `json:"destinationID"`
}

LinkRequest is used to request an link be created or updated.

type LinkResponse

type LinkResponse struct {
	// Link returns the information about a link.
	Link Link `json:"link"`
}

LinkResponse returns a link.

type LinkUpdateRequest

type LinkUpdateRequest struct {
	LinkRequest
}

LinkUpdateRequest is used to request an link be updated.

type LinksResponse

type LinksResponse struct {
	// Links returns the information about multiple links.
	Links []Link `json:"links"`
}

LinksResponse returns multiple links.

type Player

type Player struct {
	// ID is the player identifier.
	ID string `json:"id"`

	// Name is the player name.
	Name string `json:"name"`

	// Description is the player description.
	Description string `json:"description"`

	// HomeID is the RoomID of the player's home.
	HomeID string `json:"homeID"`

	// LocationID is the RoomID of the player's location.
	LocationID string `json:"locationID"`

	// Created is the time of the player's creation.
	Created arcade.Timestamp `json:"created"`

	// Updated is the time the player was last updated.
	Updated arcade.Timestamp `json:"updated"`
}

Player holds a player's information, and is sent in a response.

type PlayerCreateRequest

type PlayerCreateRequest struct {
	PlayerRequest
}

PlayerCreateRequest is used to request an player be created.

type PlayerRequest

type PlayerRequest struct {
	// Name is the name of the player.
	Name string `json:"name"`

	// Description is the description of the player.
	Description string `json:"description"`

	// HomeID is the ID of the home of the player.
	HomeID string `json:"homeID"`

	// LocationID is the ID of the location of the player.
	LocationID string `json:"locationID"`
}

PlayerRequest is used to request an player be created or updated.

type PlayerResponse

type PlayerResponse struct {
	// Player returns the information about a player.
	Player Player `json:"player"`
}

PlayerResponse returns a player.

type PlayerUpdateRequest

type PlayerUpdateRequest struct {
	PlayerRequest
}

PlayerUpdateRequest is used to request an player be updated.

type PlayersResponse

type PlayersResponse struct {
	// Players returns the information about multiple players.
	Players []Player `json:"players"`
}

PlayersResponse returns multiple players.

type Room

type Room struct {
	// ID is the room identifier.
	ID string `json:"id"`

	// Name is the room name.
	Name string `json:"name"`

	// Description is the room description.
	Description string `json:"description"`

	// OwnerID is the PlayerID of the room owner.
	OwnerID string `json:"ownerID"`

	// ParentID is the RoomID of the room's parent.
	ParentID string `json:"parentID"`

	// Created is the time of the room's creation.
	Created arcade.Timestamp `json:"created"`

	// Updated is the time the room was last updated.
	Updated arcade.Timestamp `json:"updated"`
}

Room holds a room's information, and is sent in a response.

type RoomCreateRequest

type RoomCreateRequest struct {
	RoomRequest
}

RoomCreateRequest is used to request an room be created.

type RoomRequest

type RoomRequest struct {
	// Name is the name of the room.
	Name string `json:"name"`

	// Description is the description of the room.
	Description string `json:"description"`

	// OwnerID is the ID of the owner of the room.
	OwnerID string `json:"ownerID"`

	// ParentID is the ID of the parent of the room.
	ParentID string `json:"parentID"`
}

RoomRequest is used to request an item be created or updated.

type RoomResponse

type RoomResponse struct {
	// Room returns the information about a room.
	Room Room `json:"room"`
}

RoomResponse returns a room.

type RoomUpdateRequest

type RoomUpdateRequest struct {
	RoomRequest
}

RoomUpdateRequest is used to request an room be updated.

type RoomsResponse

type RoomsResponse struct {
	// Rooms returns the information about multiple rooms.
	Rooms []Room `json:"rooms"`
}

RoomsResponse returns multiple rooms.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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