pluginData

Methods
6
Fields
None

Getting one

pluginData

Methods

MethodReturnsDescription
publish(string, string)numberPublish json under topic, replacing what was there; the new version. topic is "<this plugin's id>/<name>"; anything else, more than…
get(string)string?The JSON last published under topic, or nil.
version(string)numberThe version of topic (0 when nothing is published): changes on every publish.
publisher(string)string?The id of the plugin that published topic, or nil.
clear(string)booleanRemove topic, if this plugin published it.
topics(){string}Every topic, sorted.

Method details

publish

publish: (PluginData, string, string) -> number

Publish json under topic, replacing what was there; the new version. topic is "<this plugin's id>/<name>"; anything else, more than 256 KiB, or a 65th topic, is an error.

get

get: (PluginData, string) -> string?

The JSON last published under topic, or nil.

version

version: (PluginData, string) -> number

The version of topic (0 when nothing is published): changes on every publish.

publisher

publisher: (PluginData, string) -> string?

The id of the plugin that published topic, or nil.

clear

clear: (PluginData, string) -> boolean

Remove topic, if this plugin published it.