Documentation
¶
Index ¶
- func GetCache(key string) ([]byte, error)
- func GetStore(key string) ([]byte, error)
- func ListDirectory(path string) ([]string, error)
- func ReadFile(path string) ([]byte, error)
- func RegisterPlugin(p Plugin)
- func SendImage(recipient, imagePath string) error
- func SetCache(key string, value []byte) error
- func SetStore(key string, value []byte) error
- type CLIInput
- type CLIOutput
- type CLIPlugin
- type ExecCommandRequest
- type ExecCommandResponse
- type HelpOutput
- type Input
- type ListDirectoryResponse
- type MessageInfo
- type Output
- type Plugin
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStore ¶
GetStore retrieves a value from the store by key (deprecated, use Storage().Get() instead)
func ListDirectory ¶
ListDirectory lists the contents of a directory within the plugin's data directory
func RegisterPlugin ¶
func RegisterPlugin(p Plugin)
RegisterPlugin registers a plugin instance with the framework. This should be called from the plugin's main function.
Types ¶
type CLIInput ¶
type CLIInput struct {
Args []string `json:"args"`
}
CLIInput represents the input data passed to a plugin's CLI handler.
type CLIOutput ¶
type CLIOutput struct {
Success bool `json:"success"`
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
}
CLIOutput represents the response from a plugin's CLI handler.
type ExecCommandRequest ¶
type ExecCommandRequest struct {
Command string `json:"command"`
Stdin string `json:"stdin,omitempty"`
}
ExecCommandRequest is the request payload for ExecCommand.
type ExecCommandResponse ¶
type ExecCommandResponse struct {
Success bool `json:"success"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
ExitCode int `json:"exit_code"`
Error string `json:"error,omitempty"`
}
ExecCommandResponse is the response from ExecCommand.
func ExecCommand ¶
func ExecCommand(command, stdin string) (*ExecCommandResponse, error)
ExecCommand executes a whitelisted command on the host with optional stdin.
type HelpOutput ¶
type HelpOutput struct {
Name string `json:"name"`
Description string `json:"description"`
Usage string `json:"usage"`
Examples []string `json:"examples"`
Category string `json:"category"`
}
HelpOutput contains help information for a plugin
func NewHelpOutput ¶
func NewHelpOutput(name, description, usage string, examples []string, category string) HelpOutput
NewHelpOutput creates a new HelpOutput with the given parameters
type Input ¶
type Input struct {
Message string `json:"message"`
Sender string `json:"sender"`
Info MessageInfo `json:"info"`
}
Input represents the input data passed to a plugin
type ListDirectoryResponse ¶
type MessageInfo ¶
type MessageInfo struct {
ID string `json:"id"`
Timestamp int64 `json:"timestamp"`
PushName string `json:"push_name"`
IsGroup bool `json:"is_group"`
}
MessageInfo contains information about the incoming message
type Output ¶
type Output struct {
Success bool `json:"success"`
Error string `json:"error,omitempty"`
Reply string `json:"reply,omitempty"`
}
Output represents the response from a plugin