streamdeckcore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, cfg *Config, plugin Plugin) error

Serve wraps a websocket to handle receiving and publishing events. To shutdown, cancel the provided context.

Types

type ActionUUID

type ActionUUID string

ActionUUID is an action's unique identifier.

type Config

type Config struct {
	Port          int
	PluginUUID    PluginUUID
	RegisterEvent EventName
	Info          string
}

Config holds the launch configuration for a plugin.

func ParseConfig

func ParseConfig(args []string) (*Config, error)

ParseConfig parses the configuration from the provide arguments.

type DeviceName

type DeviceName string

DeviceName is the name of a device.

type DeviceUUID

type DeviceUUID string

DeviceUUID is a device's unique identifier.

type EventContext

type EventContext string

EventContext is the unique identifier for an instance of an action.

type EventName

type EventName string

EventName is the name of an event sent or received from a device.

type Handler

type Handler interface {
	HandleEvent(ctx context.Context, raw json.RawMessage) error
}

Handler is implemented to handle events.

type Plugin

type Plugin interface {
	Handler
	Initialize(pluginUUID PluginUUID, publisher Publisher)
}

Plugin is implemented by a plugin in order to interact with a device.

type PluginUUID

type PluginUUID string

PluginUUID is the unique identifier assigned to a plugin by a device.

type ProfileName

type ProfileName string

ProfileName is the name of a profile.

type Publisher

type Publisher interface {
	PublishEvent(raw json.RawMessage) error
}

Publisher is provided to Plugins so they can communicate with a device.

Jump to

Keyboard shortcuts

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