botconfig

package
v0.0.0-...-b146d40 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	BotID   string `toml:"id" bson:"id"`
	Type    string `toml:"type" bson:"type"`
	Enabled bool   `toml:"enabled" bson:"enabled"`

	StorageConfig StorageConfig `toml:"storage" bson:"storage"`

	Config  map[string]interface{} `toml:"config" bson:"config"`
	Plugins PluginConfigs          `toml:"plugins" bson:"plugins"`
}

BotConfig holds the configuration for one bot

func (*BotConfig) AsDiscordConfig

func (c *BotConfig) AsDiscordConfig() (DiscordConfig, error)

AsDiscordConfig converts the config to a DiscordConfig

func (*BotConfig) AsMatrixConfig

func (c *BotConfig) AsMatrixConfig() (MatrixConfig, error)

AsMatrixConfig converts the config to a MatrixConfig

func (*BotConfig) AsMattermostConfig

func (c *BotConfig) AsMattermostConfig() (MattermostConfig, error)

AsMattermostConfig converts the config to a MattermostConfig

func (*BotConfig) AsSlackConfig

func (c *BotConfig) AsSlackConfig() (SlackConfig, error)

AsSlackConfig converts the config to a SlackConfig

func (*BotConfig) AsTwitchConfig

func (c *BotConfig) AsTwitchConfig() (TwitchConfig, error)

AsTwitchConfig converts the config to a TwitchConfig

type BotConfigs

type BotConfigs map[string]BotConfig

BotConfigs holds a collection of BotConfigs identified by an unique id

type DiscordConfig

type DiscordConfig struct {
	ID     string `toml:"id" toml:"id"`
	Token  string `toml:"token" toml:"token"`
	Secret string `toml:"secret" toml:"secret"`
}

DiscordConfig contains config related to the Discord component

type MatrixConfig

type MatrixConfig struct {
	Server   string `toml:"server" json:"server"`
	Username string `toml:"username" json:"username"`
	Password string `toml:"password" json:"password"`
}

MatrixConfig contains config related to the Matrix component

type MattermostConfig

type MattermostConfig struct {
	Server   string `toml:"server" json:"server"`
	Username string `toml:"username" json:"username"`
	Password string `toml:"password" json:"password"`
}

MattermostConfig contains config related to the Mattermost component

type PluginConfig

type PluginConfig struct {
	Type string `toml:"type" bson:"type"`

	Config map[string]interface{} `toml:"config" bson:"config"`
}

PluginConfig holds the configuration for one plugin

type PluginConfigs

type PluginConfigs map[string]PluginConfig

PluginConfigs holds a collection of PluginConfigs identified by an unique id

type SlackConfig

type SlackConfig struct {
	Workspace string `toml:"workspace" json:"workspace"`
	Token     string `toml:"token" json:"token"`
}

SlackConfig contains config related to the Mattermost component

type StorageConfig

type StorageConfig struct {
	Type string `toml:"type" bson:"type"`

	Config map[string]interface{} `toml:"config" bson:"config"`
}

StorageConfig holds the configuration for a storage

type TwitchConfig

type TwitchConfig struct {
	Username string   `toml:"username" json:"username"`
	Token    string   `toml:"token" json:"token"`
	Channels []string `toml:"channels" json:"channels"`
}

TwitchConfig contains config related to the Twitch component

Jump to

Keyboard shortcuts

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