Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurer ¶
type Configurer interface { Plugin // DefaultConfig will be called on plugin first run to set the default config. // DefaultConfig will also be used if the provided config cannot be validate during initialization. // The default configuration will be provided to the user for future editing. Used for generating schemas and unmarshaling. DefaultConfig() interface{} // ValidateAndSetConfig will be called every time the plugin is initialized or the configuration has been changed by the user. // Plugins should check whether the configuration is valid and optionally return an error. // Parameter is guaranteed to be the same type as the return type of DefaultConfig() ValidateAndSetConfig(c interface{}) error }
Configurer is the interface plugins should implement in order to provide configuration interface to the user
type Displayer ¶
Displayer is the interface plugins should implement to show a text to the user. The text will appear on the plugin details page and can be multi-line. Markdown syntax is allowed. Good for providing dynamically generated instructions to the user. Location is the current location the user is accessing the API from, nil if not recoverable. Location contains the path to the display api endpoint, you may only need the base url. Example: https://gotify.net/plugin/5/display
type Info ¶
type Info struct { Version string Author string Name string Website string Description string License string ModulePath string }
Info is returned by the exported plugin function GetPluginInfo() for identification plugins are identified by their ModulePath, gotify will refuse to load plugins with empty ModulePath
type MessageHandler ¶
type MessageHandler interface { // SendMessage sends a message with the given information in the request. SendMessage(msg Message) error }
MessageHandler consists of message callbacks to be used by plugins.
type Messenger ¶
type Messenger interface { Plugin // SetMessageHandler is called every time the plugin is initialized. // Plugins should record the handler and use the callbacks provided in the handler to send messages. SetMessageHandler(h MessageHandler) }
Messenger is the interface plugins should implement to send messages.
type Plugin ¶
type Plugin interface { // Enable is called every time a plugin is started. Spawn custom goroutines here for polling, etc. // It is always called after ^Set.*Handler$ Enable() error // Disable is called every time a plugin is disabled. Plugins should stop all custom goroutines here. Disable() error }
Plugin is the interface every plugin need to implement
type StorageHandler ¶
StorageHandler consists callbacks used to perform read/writes to the persistent storage for plugins.
type Storager ¶
type Storager interface { Plugin SetStorageHandler(handler StorageHandler) }
Storager is the interface plugins should implement to use persistent storage.
type UserContext ¶
UserContext is provided when calling New to create a plugin instance for each user
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
gomod-cap
gomod-cap This command line util is used to help plugins keep their go.mod file requirements lower than the gotify-server itself in order to make sure that plugins are built with the same version of dependencies as the main gotify program does.
|
gomod-cap This command line util is used to help plugins keep their go.mod file requirements lower than the gotify-server itself in order to make sure that plugins are built with the same version of dependencies as the main gotify program does. |