Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeValueInto ¶
func MergeValueInto[T comparable](target *T, source T)
Types ¶
type CommandInterface ¶
type CommonBotCliArgs ¶
type CommonBotCliArgs struct {
Config string `short:"c" help:"Configuration file path ($BOT_CONFIG_PATH)"`
Recipients []string `short:"r" help:"Message recipients, comma separated (defaults to value from config or $BOT_RECIPIENTS)"`
BotToken string `yaml:"bot_token" help:"Your bot token as given by botfather (defaults to value from config or $BOT_TOKEN)"`
}
func (*CommonBotCliArgs) MergeConfig ¶
func (cmd *CommonBotCliArgs) MergeConfig(cfg config.Config)
func (*CommonBotCliArgs) ValidatePostMerge ¶
func (cmd *CommonBotCliArgs) ValidatePostMerge() error
type GenerateKey ¶
type GenerateKey struct{}
func (*GenerateKey) Run ¶
func (cmd *GenerateKey) Run() error
type Send ¶
type Send struct {
CommonBotCliArgs `embed:""`
ParseMode string `short:"m" placeholder:"MarkdownV2" help:"Message parse mode"`
Message string `arg:"" optional:"" help:"Message to send. Read from STDIN if not specified"`
}
type Serve ¶
type Serve struct {
CommonBotCliArgs `embed:""`
Address string `arg:"" optional:"" env:"BOT_ADDR" placeholder:"localhost:6000" help:"HTTP server listening address ($BOT_ADDR)"`
LogType string `placeholder:"text" help:"Logger output type ($BOT_LOG_TYPE)"`
LogLevel string `placeholder:"info" help:"Minimum logging level ($BOT_LOG_LEVEL)"`
ApiKey string `help:"API key, passed in 'x-api-key' header to authorize incoming requests ($BOT_API_KEY)"`
}
func (*Serve) MergeConfig ¶
func (*Serve) ValidatePostMerge ¶
Click to show internal directories.
Click to hide internal directories.