config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandConfig

type CommandConfig struct {
	Command              string              `yaml:"command"`
	Token                string              `yaml:"token"`
	DialogURL            string              `yaml:"dialog_url"`
	DialogResponseURL    string              `yaml:"dialog_response_url"`
	SchedulerResponseURL string              `yaml:"scheduler_response_url"`
	Plugins              []CommandPlugin     `yaml:"plugins"`
	AccessControl        model.AccessControl `yaml:"access_control"`
}

type CommandPlugin

type CommandPlugin struct {
	Name    string
	Only    []string
	Exclude []string
}

func (*CommandPlugin) UnmarshalYAML

func (cp *CommandPlugin) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface. The CommandPlugin can either be a string corresponding to the name, or a CommandPlugin

type Config

type Config struct {
	Listen                string                   `yaml:"listen"`
	BaseURL               string                   `yaml:"base_url"`
	PluginsConfig         []PluginConfig           `yaml:"plugins"`
	CommandConfigurations []CommandConfig          `yaml:"commands"`
	ScheduledCommands     []ScheduledCommandConfig `yaml:"scheduler"`
}

func Load

func Load(ctx context.Context, path string) (*Config, error)

type PluginConfig

type PluginConfig struct {
	Name   string     `yaml:"name"`
	File   string     `yaml:"file"`
	Config RawMessage `yaml:"config"`
}

type RawMessage

type RawMessage struct {
	// contains filtered or unexported fields
}

func (*RawMessage) Unmarshal

func (msg *RawMessage) Unmarshal(v interface{}) error

func (*RawMessage) UnmarshalYAML

func (msg *RawMessage) UnmarshalYAML(unmarshal func(interface{}) error) error

type ScheduledCommandConfig

type ScheduledCommandConfig struct {
	Name        string `yaml:"name"`
	Cron        string `yaml:"cron"`
	Command     string `yaml:"command"`
	Channel     string `yaml:"channel"`
	ResponseURL string `yaml:"response_url"`
}

Jump to

Keyboard shortcuts

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