Documentation ¶
Overview ¶
Package shared defines data structures that are used both by the server and by the web client. These are typically data types transferred as JSON.
Index ¶
- type Data
- type Group
- type GroupCreationRequest
- type GroupModificationRequest
- type Hero
- type HeroModificationRequest
- type Message
- type Module
- type ModuleConfig
- type ModuleIndex
- type Plugin
- type Scene
- type SceneCreationRequest
- type SceneModificationRequest
- type State
- type StateRequest
- type StateResponse
- type Static
- type System
- type SystemModificationRequest
- type TemplateDescr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { Name string `json:"name"` ID string `json:"id"` SystemIndex int `json:"systemIndex"` Heroes []Hero `json:"heroes"` Scenes []Scene `json:"scenes"` }
Group describes a dataset for a pen & paper roleplaying group.
type GroupCreationRequest ¶
type GroupCreationRequest struct { Name string `json:"name"` PluginIndex int `json:"pluginIndex"` GroupTemplateIndex int `json:"groupTemplateIndex"` }
GroupCreationRequest is sent from the client to the server to request the creation of a group.
type GroupModificationRequest ¶
type GroupModificationRequest struct { Name string `json:"name"` SystemIndex int `json:"systemIndex"` }
GroupModificationRequest is sent from the client to the server to request the modification of a group.
type Hero ¶
type Hero struct { Name string `json:"name"` ID string `json:"id"` Description string `json:"description"` }
Hero describes a hero in a group.
type HeroModificationRequest ¶
type HeroModificationRequest struct { Name string `json:"name"` Description string `json:"description"` }
HeroModificationRequest is sent from the client to the server to request the modification of a hero.
type Message ¶
type Message struct { // true if this is an error, false if it's just a warning. IsError bool `json:"isError"` // Index of the module the message is issued from, -1 if none ModuleIndex ModuleIndex `json:"moduleIndex"` // text to display Text string `json:"text"` }
Message is a warning or an error that should be displayed on the starting screen of the client.
type Module ¶
type Module struct { Name string `json:"name"` // <plugin-id>/<module-id> Path string `json:"path"` }
Module describes a loaded module.
type ModuleIndex ¶
type ModuleIndex int
ModuleIndex identifies a module internally. This is not the index of a module inside a plugin.
const FirstModule ModuleIndex = 0
FirstModule is the index of the first module
type Plugin ¶
type Plugin struct { Name string `json:"name"` ID string `json:"id"` SystemTemplates []TemplateDescr GroupTemplates []TemplateDescr SceneTemplates []TemplateDescr }
Plugin describes a loaded plugin.
type Scene ¶
type Scene struct { Name string `json:"name"` ID string `json:"id"` Modules []bool `json:"modules"` }
Scene describes a scene of a group.
type SceneCreationRequest ¶
type SceneCreationRequest struct { Name string `json:"name"` PluginIndex int `json:"pluginIndex"` SceneTemplateIndex int `json:"sceneTemplateIndex"` }
SceneCreationRequest is sent from the client to the server to request the creation of a scene.
type SceneModificationRequest ¶
SceneModificationRequest is sent from the client to the server to request the modification of a scene's name and modules.
type State ¶
State contains the current state, including currently active group and scene. The state of the modules is local to the session page and not available globally.
type StateRequest ¶
type StateResponse ¶
type StateResponse struct { ActiveGroup int `json:"activeGroup"` ActiveScene int `json:"activeScene"` Modules []json.RawMessage `json:"modules"` }
type Static ¶
type Static struct { Fonts []string `json:"fonts"` Textures []resources.Resource `json:"textures"` NumPluginSystems int `json:"numPluginSystems"` Plugins []Plugin `json:"plugins"` FontDir string `json:"fontDir"` Messages []Message `json:"messages"` AppVersion string `json:"appVersion"` Modules []Module `json:"modules"` }
Static describes static data that will never change during the lifetime of the server/client.
type SystemModificationRequest ¶
type SystemModificationRequest struct {
Name string `json:"name"`
}
SystemModificationRequest is sent from the client to the server to request the modification of a system.
type TemplateDescr ¶
type TemplateDescr struct {
Name, Description string
}
TemplateDescr describes an available template for a system, group or scene.