api

package
v0.18.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type PluginDependencyURLsGetter interface {
	GetUrls() map[string]string
}

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.

type URLs added in v0.18.0

type URLs map[string]string

URLs is a map of URLs for different platform and architecture. The key format is "{os}/{arch}".

func (URLs) For added in v0.18.0

func (u URLs) For(os, arch string) (string, bool)

For returns the URL for a given platform and architecture.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL