config

package
v0.0.3-0...-fb11c36 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Bots     map[string]*Bot     `yaml:"bots"`
	Messages map[string]*Message `yaml:"messages"`
}

App represents the app's configuration

func NewAppFromYaml

func NewAppFromYaml(path string) (*App, error)

NewAppFromYaml returns the app data from provided yaml file

func (*App) Validate

func (a *App) Validate() error

Validate validates an app config

type Bot

type Bot struct {
	Platform string `yaml:"platform"`
	APIKey   string `yaml:"api_key"`
}

Bot represents a bot config

type Message

type Message struct {
	Messengers         []Messenger `yaml:"messengers"`
	Schedule           string      `yaml:"schedule"`
	Body               string      `yaml:"body"`
	ExpireTime         string      `yaml:"expiretime"`
	DisableLinkPreview bool        `yaml:"disable_link_preview"`
}

Message represents the configuration of a single Messaged message

type Messenger

type Messenger struct {
	Bot     string   `yaml:"bot"`
	ChatIDs []string `yaml:"chat_ids"`
}

Messenger represents a messenger of a message

Jump to

Keyboard shortcuts

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