app

package
v0.1.1-0...-1ecdc53 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	AddPlugin(id string, plugin *Plugin) error
	DataDir(subdirs ...string) string
	NumPlugins() int
	Plugin(index int) *Plugin
	PluginID(index int) string
	NumModules() shared.ModuleIndex
	ModuleAt(index shared.ModuleIndex) *modules.Module
	ModuleID(index shared.ModuleIndex) string
	ModulePluginIndex(index shared.ModuleIndex) int
	ModuleFor(pluginID, moduleID string) shared.ModuleIndex
	// ServerContext builds a server.Context with the given moduleIndex.
	ServerContext(moduleIndex shared.ModuleIndex) server.Context
	GetResources(moduleIndex shared.ModuleIndex,
		index resources.CollectionIndex) []resources.Resource
	GetTextures() []resources.Resource
	Font(fontFamily int, style api.FontStyle, size api.FontSize) *ttf.Font
	NumFontFamilies() int
	FontNames() []string
	Messages() []shared.Message
	MessageSenderFor(index shared.ModuleIndex) server.MessageSender
}

App is the interface to the application for the data and display modules.

type GroupTemplate

type GroupTemplate struct {
	Name, Description string
	// YAML content of the configuration. The group name contained herein will
	// always be overridden when applying the template.
	Config []byte
	// list of scenes in this group.
	//
	// At least one scene index must be defined for any GroupTemplate.
	// The reference defines the name of the scene in this group.
	Scenes []SceneTmplRef
}

GroupTemplate is a template to create a group from. Groups are always created from templates, the default and minimal templates are provided by the base plugin.

func (*GroupTemplate) MarshalJSON

func (gt *GroupTemplate) MarshalJSON() ([]byte, error)

MarshalJSON serializes a GroupTemplate for communication to the client

type Plugin

type Plugin struct {
	// Name contains the name of the plugin.
	Name string
	// Modules contains the list of modules provided by this plugin.
	Modules []*modules.Module
	// SystemTemplates defines templates for creating systems.
	// It should provide a template for each system ID that is referenced from a
	// template in GroupTemplates.
	SystemTemplates []SystemTemplate
	// GroupTemplates defines templates for creating groups.
	// It should only reference system IDs for which templates exist in
	// SystemTemplates.
	GroupTemplates []GroupTemplate
	// SceneTemplates defines templates for creating scenes.
	// These scenes can be referenced from GroupTemplates.
	SceneTemplates []SceneTemplate
}

Plugin describes a module provider.

func (*Plugin) MarshalJSON

func (p *Plugin) MarshalJSON() ([]byte, error)

MarshalJSON serializes a plugin for communication to the client

type SceneTemplate

type SceneTemplate struct {
	Name, Description string
	// YAML content of the configuration. The scene name contained herein will
	// always be overridden when applying the template.
	Config []byte
}

SceneTemplate is a template to create a scene from. It is typically used for defining scenes created as part of group templates, but can also be used on its own to create a new scene for an existing group.

func (*SceneTemplate) MarshalJSON

func (st *SceneTemplate) MarshalJSON() ([]byte, error)

MarshalJSON serializes a SceneTemplate for communication to the client

type SceneTmplRef

type SceneTmplRef struct {
	// The name this scene should have in the containing group
	Name string
	// index of the plugin defining the scene template
	PluginIndex int
	// index of the template referred to in its plugin's list of templates
	TmplIndex int
}

SceneTmplRef is a reference to a scene template to be used in group templates

type SystemTemplate

type SystemTemplate struct {
	// YAML content of the configuration. the contained name should be equivalent
	// to the Name field.
	Config []byte
	ID     string
	Name   string
}

SystemTemplate is a template to create a system from. The template is given as YAML file because the module API is not designed to create standalone state objects that would be required to define such a template.

type TooManyRequests

type TooManyRequests struct {
}

TooManyRequests is an error that is issued if the server receives more data than the rendering thread can process.

func (TooManyRequests) Error

func (TooManyRequests) Error() string

Error returns "Too many requests"

func (TooManyRequests) StatusCode

func (TooManyRequests) StatusCode() int

StatusCode returns 503

Jump to

Keyboard shortcuts

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