Documentation ¶
Index ¶
- Constants
- func ReturnErrorOnDisableForUser(uid uint, err error)
- func ReturnErrorOnEnableForUser(uid uint, err error)
- type Plugin
- type PluginConfig
- type PluginInstance
- func (c *PluginInstance) DefaultConfig() interface{}
- func (c *PluginInstance) Disable() error
- func (c *PluginInstance) Enable() error
- func (c *PluginInstance) GetDisplay(url *url.URL) string
- func (c *PluginInstance) GetStorage() ([]byte, error)
- func (c *PluginInstance) RegisterWebhook(basePath string, mux *gin.RouterGroup)
- func (c *PluginInstance) SetCapability(p compat.Capability, enable bool)
- func (c *PluginInstance) SetMessageHandler(h compat.MessageHandler)
- func (c *PluginInstance) SetStorage(b []byte) error
- func (c *PluginInstance) SetStorageHandler(handler compat.StorageHandler)
- func (c *PluginInstance) Supports() compat.Capabilities
- func (c *PluginInstance) TriggerMessage()
- func (c *PluginInstance) ValidateAndSetConfig(config interface{}) error
Constants ¶
const ModulePath = "github.com/gotify/server/v2/plugin/testing/mock"
ModulePath is for convenient access of the module path of this mock plugin
const Name = "mock plugin"
Name is for convenient access of the module path of the name of this mock plugin
Variables ¶
This section is empty.
Functions ¶
func ReturnErrorOnDisableForUser ¶
ReturnErrorOnDisableForUser registers a uid which will throw an error on disabling.
func ReturnErrorOnEnableForUser ¶
ReturnErrorOnEnableForUser registers a uid which will throw an error on enabling.
Types ¶
type Plugin ¶
type Plugin struct {
Instances []PluginInstance
}
Plugin is a mock plugin.
func (*Plugin) APIVersion ¶
APIVersion implements loader.PluginCompat
func (*Plugin) NewPluginInstance ¶
func (c *Plugin) NewPluginInstance(ctx compat.UserContext) compat.PluginInstance
NewPluginInstance implements loader.PluginCompat
func (*Plugin) PluginInfo ¶
PluginInfo implements loader.PluginCompat
type PluginConfig ¶
PluginConfig is a mock plugin config struct
type PluginInstance ¶
type PluginInstance struct { UserCtx compat.UserContext Enabled bool DisplayString string Config *PluginConfig BasePath string // contains filtered or unexported fields }
PluginInstance is a mock plugin instance
func (*PluginInstance) DefaultConfig ¶
func (c *PluginInstance) DefaultConfig() interface{}
DefaultConfig implements compat.Configuror
func (*PluginInstance) Disable ¶
func (c *PluginInstance) Disable() error
Disable implements compat.PluginInstance
func (*PluginInstance) Enable ¶
func (c *PluginInstance) Enable() error
Enable implements compat.PluginInstance
func (*PluginInstance) GetDisplay ¶
func (c *PluginInstance) GetDisplay(url *url.URL) string
GetDisplay implements compat.Displayer
func (*PluginInstance) GetStorage ¶
func (c *PluginInstance) GetStorage() ([]byte, error)
GetStorage sets current storage
func (*PluginInstance) RegisterWebhook ¶
func (c *PluginInstance) RegisterWebhook(basePath string, mux *gin.RouterGroup)
RegisterWebhook implements compat.Webhooker
func (*PluginInstance) SetCapability ¶
func (c *PluginInstance) SetCapability(p compat.Capability, enable bool)
SetCapability changes the capability of this plugin
func (*PluginInstance) SetMessageHandler ¶
func (c *PluginInstance) SetMessageHandler(h compat.MessageHandler)
SetMessageHandler implements compat.Messenger
func (*PluginInstance) SetStorage ¶
func (c *PluginInstance) SetStorage(b []byte) error
SetStorage sets current storage
func (*PluginInstance) SetStorageHandler ¶
func (c *PluginInstance) SetStorageHandler(handler compat.StorageHandler)
SetStorageHandler implements compat.Storager
func (*PluginInstance) Supports ¶
func (c *PluginInstance) Supports() compat.Capabilities
Supports implements compat.PluginInstance
func (*PluginInstance) TriggerMessage ¶
func (c *PluginInstance) TriggerMessage()
TriggerMessage triggers a test message
func (*PluginInstance) ValidateAndSetConfig ¶
func (c *PluginInstance) ValidateAndSetConfig(config interface{}) error
ValidateAndSetConfig implements compat.Configuror