Documentation ¶
Index ¶
- Variables
- func ConvertDependenciesFromAPI[T PluginDependencyURLsSetter[P], P any](in map[string]Dependency) map[string]T
- func ConvertDependenciesToAPI[T PluginDependencyURLsGetter](resp map[string]T) map[string]Dependency
- type Dependency
- type JSONSchema
- type MetadataOutput
- type PluginDependencyURLsGetter
- type PluginDependencyURLsSetter
- type URLs
Constants ¶
This section is empty.
Variables ¶
var HandshakeConfig = plugin.HandshakeConfig{
MagicCookieKey: "BOTKUBE",
MagicCookieValue: "52ca7b74-28eb-4fac-ae79-31a9cbda2454",
}
HandshakeConfig is common handshake config between Botkube and its plugins.
Functions ¶
func ConvertDependenciesFromAPI ¶ added in v0.18.0
func ConvertDependenciesFromAPI[T PluginDependencyURLsSetter[P], P any](in map[string]Dependency) map[string]T
ConvertDependenciesFromAPI converts API dependencies to source/executor plugin dependencies.
func ConvertDependenciesToAPI ¶ added in v0.18.0
func ConvertDependenciesToAPI[T PluginDependencyURLsGetter](resp map[string]T) map[string]Dependency
ConvertDependenciesToAPI converts source/executor plugin dependencies to API dependencies.
Types ¶
type Dependency ¶ added in v0.18.0
type Dependency struct { // URLs holds the URLs for a given dependency depending on the platform and architecture. URLs URLs `yaml:"urls"` }
Dependency holds the dependency information.
type JSONSchema ¶ added in v0.18.0
type JSONSchema struct { // Value is the JSON schema string. Value string // RefURL is the remote reference of the schema. RefURL string }
JSONSchema contains the JSON schema or a remote reference where the schema can be found. Value and RefURL are mutually exclusive
type MetadataOutput ¶
type MetadataOutput struct { // Version is a version of a given plugin. It should follow the SemVer syntax. Version string // Descriptions is a description of a given plugin. Description string // JSONSchema is a JSON schema for a given plugin. JSONSchema JSONSchema // Dependencies holds the dependencies for a given platform binary. Dependencies map[string]Dependency }
MetadataOutput contains the metadata of a given plugin.
func (MetadataOutput) Validate ¶
func (m MetadataOutput) Validate() error
Validate validate the metadata fields and returns detected issues.
type PluginDependencyURLsGetter ¶ added in v0.18.0
PluginDependencyURLsGetter is an interface for getting plugin dependency URLs.
type PluginDependencyURLsSetter ¶ added in v0.18.0
type PluginDependencyURLsSetter[T any] interface { SetUrls(in map[string]string) *T // This is needed to ensure we can create an instance of the concrete type as a part of the ConvertDependenciesFromAPI function. }
PluginDependencyURLsSetter is an interface for setting plugin dependency URLs.