settings

package
v0.0.0-...-93f332f Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandSettings

type CommandSettings struct {
	CommandTrigger string              `json:"command_start"`
	Insults        []string            `json:"insults"`
	Quotes         []string            `json:"quotes"`
	Praises        []string            `json:"praises"`
	Reactions      map[string]Reaction `json:"reactions"`
}

type Config

type Config struct {
	Server struct {
		HOST     string `yaml:"host"`
		PROTOCOL string `yaml:"protocol"`
		PORT     string `yaml:"port"`
	} `yaml:"server"`
	Bot struct {
		SAMPLE_NAME   string `yaml:"sample_name"`
		USER_EMAIL    string `yaml:"user_email"`
		USERNAME      string `yaml:"username"`
		USER_FIRST    string `yaml:"user_first"`
		USER_LAST     string `yaml:"user_last"`
		USER_PASSWORD string `yaml:"user_password"`
		TEAM_NAME     string `yaml:"team_name"`
		LOG_NAME      string `yaml:"log_name"`
		SETTINGS_URL  string `yaml:"settings_url"`
	} `yaml:"bot"`
	Cache struct {
		CONN_STR string `yaml:"connection_string"`
	} `yaml:"cache"`
}

func GetConfig

func GetConfig(env string) (*Config, error)

GetConfig reads the bot configuration file and loads into a Config struct

type Reaction

type Reaction struct {
	Url         string `json:"url"`
	Description string `json:"description"`
}

type Settings

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

func NewSettings

func NewSettings(settingsUrl string) (*Settings, error)

func (*Settings) GetCommandTrigger

func (c *Settings) GetCommandTrigger() string

func (*Settings) GetInsults

func (c *Settings) GetInsults() []string

func (*Settings) GetPraises

func (c *Settings) GetPraises() []string

func (*Settings) GetQuotes

func (c *Settings) GetQuotes() []string

func (*Settings) GetReactions

func (c *Settings) GetReactions() map[string]Reaction

func (*Settings) LoadSettings

func (c *Settings) LoadSettings() error

Jump to

Keyboard shortcuts

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